-
Notifications
You must be signed in to change notification settings - Fork 87
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
Force Julia to specialize on ::Function arguments. #1264
Conversation
With the precompile statements (base) oscar@Oscars-MBP scripts % '/Applications/Julia-1.6.app/Contents/Resources/julia/bin/julia' --project=. precompile.jl
8.106619 seconds (22.41 M allocations: 1.234 GiB, 5.04% gc time, 27.18% compilation time) |
There are two commits here. I can either split them in two PRs, or we can use "Rebase and merge" to add them as separate commits to |
If |
So it's not the case that we want this as the default. The heuristic is there for a good reason: most times it is more expensive to compile the method than the added runtime benefit. I've gone through and removed some of the cases that didn't do anything. |
|
Rebased onto
|
See the section in Performance Tips:
https://docs.julialang.org/en/v1/manual/performance-tips/index.html#Be-aware-of-when-Julia-avoids-specializing
This should help simplify (and improve) the precompilation files.
Benchmark
Using the script from jump-dev/JuMP.jl#2484
Before
After