Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor inference and specialization improvements #461

Merged
merged 4 commits into from
Dec 20, 2020
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Dec 19, 2020

No description provided.

@codecov
Copy link

codecov bot commented Dec 19, 2020

Codecov Report

Merging #461 (533676e) into master (381ee91) will increase coverage by 0.09%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #461      +/-   ##
==========================================
+ Coverage   89.69%   89.79%   +0.09%     
==========================================
  Files          12       12              
  Lines        2330     2342      +12     
==========================================
+ Hits         2090     2103      +13     
+ Misses        240      239       -1     
Impacted Files Coverage Δ
src/builtins.jl 77.83% <33.33%> (ø)
src/utils.jl 88.97% <87.50%> (+0.11%) ⬆️
src/optimize.jl 98.01% <100.00%> (+0.04%) ⬆️
src/precompile.jl 97.91% <100.00%> (+2.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 381ee91...533676e. Read the comment docs.

end
_scopename(sym) = sym
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check my understanding, does this change reduce a chance of (unused) specialization, right ? (maybe otherwise _scopename(parent, child, rest...) = Expr(:., parent, _scopename(child, rest...)) can recur back into this method ?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was more that attempts to call _scopename(sym) were being implemented by runtime-dispatch. Now that I think about it, that would also be true of longer module paths: the length of modpath is not inferrable. I should rewrite this so it never dispatches to anything. (later, busy with other things now)

@timholy
Copy link
Member Author

timholy commented Dec 20, 2020

Woot, with these changes here and a couple in LoweredCodeUtils & Revise, I've gotten the time for first revision down to 1.6s, about half of where it was a week ago. (xref JuliaLang/julia#38906, which is responsible for all but 200ms of this gain). A lot of this is just me playing with the new SnoopCompile tools and giving them a workout, wanting to make sure that they actually work to discover things that help latency. But certainly nice to have on their own.

@timholy timholy merged commit 722f82f into master Dec 20, 2020
@timholy timholy deleted the teh/inference_tweaks branch December 20, 2020 13:17
timholy added a commit to timholy/Revise.jl that referenced this pull request Dec 20, 2020
Investigation via `SnoopCompile.@snoopi_deep` identified several
opportunities to reduce latency:
- JuliaLang/julia#38906
- JuliaDebug/JuliaInterpreter.jl#461
- JuliaDebug/LoweredCodeUtils.jl#58

Together with the changes here, the aggregate effect is to reduce
the time for the first revision from 3.1s
to about 1.5s. That's much more reasonable.
timholy added a commit to timholy/Revise.jl that referenced this pull request Dec 21, 2020
Investigation via `SnoopCompile.@snoopi_deep` identified several
opportunities to reduce latency:
- JuliaLang/julia#38906
- JuliaDebug/JuliaInterpreter.jl#461
- JuliaDebug/LoweredCodeUtils.jl#58

Together with the changes here, the aggregate effect is to reduce
the time for the first revision from 3.1s
to about 1.5s. That's much more reasonable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants