-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Default env & startup.jl loading pattern can cause excessive precompilation #56766
Comments
Alternatively |
Maybe |
Or if different deps are unexpectedly loaded already the load just skips precompilation and loads the package directly without generating Update: That's proposed here #56769 |
this problem also occurs if user starts a jupyter notebook and runs a setup cell with something like: using Pkg
Pkg. activate(...) |
The messaging on master is a little clearer around this now, with JuliaLang/Pkg.jl#4109 merged |
I looked into precompiling for both clean and any dirty load state, but to do it fully in parallel I think would take a lot of additional complication, because the job needs to figure out which dep job it's waiting for, which isn't simple because I don't think the version of the dep is enough to figure that out Some attempts at that master...IanButterworth:julia:ib/precompile_clean_and_dirty However, I think it'd be pretty simple to check if each dep needed to be precompiled for dirty state after the clean state version is done. But that'd mean doubling the precompile jobs tail.. i.e. precompiling Makie twice in a row. etc. which might be annoying |
Problem
A common usage pattern is for a user to have, say Revise.jl in their default env, and loaded in their startup.jl
So
To the user they have just had to sit through their newly added packages precompile twice, without clear explanation for why.
The same can be true if the user is simply switching env after startup, but the fix there is easier to teach: start julia with
--project
to make loading Revise use the common dep versions from the target env.Potential mitigations
Julia could inform the user why the package is being precompiled again.
It already does this with the debug info in serial precompile logs i.e.
wrong dep version loaded (1)
above, but that's not the clearest messaging as it's often accompanied with other cache miss reasons that aren't clear to people unfamiliar with loading mechanics. So julia should probably add a clearer message.Provide a mechanism for packages like Revise to absorb deps as internal code, rather than a regular shared dep.
Something like
@internalize using OrderdCollections
which would expand tobut that would be harder to do for the deps of deps.
Also if the packages people are loading in their startup.jl are more mixed usage, i.e. Plots.jl, then it's not a complete solution
Unload & reload packages when needed. Perhaps prompt the user first?
Some loading multiverse where sessions can fork into different loading states and have different versions loaded at the same time. Seems hard to do while maintaining interop that a user might expect.
The text was updated successfully, but these errors were encountered: