-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Add precompilation directives #2484
Conversation
src/Containers/precompile.jl
Outdated
Base.precompile(Tuple{typeof(_to_index_tuple),Tuple{Int64, Function},Tuple{Dict{Int64, Int64}, Dict{Symbol, Int64}}}) # time: 0.002516737 | ||
Base.precompile(Tuple{typeof(_to_index_tuple),Tuple{String, Int64, Int64},Tuple{Dict{String, Int64}, Dict{Int64, Int64}, Dict{Int64, Int64}}}) # time: 0.002253078 | ||
Base.precompile(Tuple{typeof(has_dependent_sets),Vector{Any},Vector{Any}}) # time: 0.00217896 | ||
# TODO: Base.precompile(Tuple{Type{DenseAxisArray},Core.Array{T, N},Any,Tuple{Vararg{Dict, N}} where N}) # time: 0.001977609 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timholy I found that SnoopCompile.parcel(tinf)
created a lot of these invalid precompile statements. Is this a bug? Expected behavior?
Here's an example of another one: jump-dev/MathOptInterface.jl#1243 (comment)
(See the top of the PR for how I created these files.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's a bug. I haven't yet tried to reproduce this but this looks sufficiently detailed that I expect it to be straightforward. Thanks!!
Codecov Report
@@ Coverage Diff @@
## master #2484 +/- ##
==========================================
- Coverage 93.69% 93.46% -0.24%
==========================================
Files 43 45 +2
Lines 5360 5444 +84
==========================================
+ Hits 5022 5088 +66
- Misses 338 356 +18
Continue to review full report at Codecov.
|
Nice! What about using the bot to keep this list up to date? |
👍 but there are a few issues to sort first, like the invalid statements. |
It's a bit surprising that
So we get 2x speedup by reducing compilation time that was only 22% 🤔
Scary but interesting :) |
The bot doesn't use |
This PR is an attempt to get precompilation working throughout the JuMP ecosystem. There are a bunch of related PRs in other packages.
Related issues: #2273, #1181
Headline takeaways
Trying to isolate reasons, I find a lot of "Julia's specialization heuristics may be responsible," so it seems like even though we think Julia is specializing on the bridges, it actually isn't. (https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing)
Code
SnoopCompile
https://timholy.github.io/SnoopCompile.jl/stable/snoopi_deep_parcel/