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

Option to turn off all precompilation globally #298

Closed
baggepinnen opened this issue Sep 21, 2022 · 3 comments · Fixed by #334
Closed

Option to turn off all precompilation globally #298

baggepinnen opened this issue Sep 21, 2022 · 3 comments · Fixed by #334

Comments

@baggepinnen
Copy link

baggepinnen commented Sep 21, 2022

Since the introduction of SnoopPrecompile, I've noticed a rather dramatic impact on my developer productivity. As a developer of many different packages, many of them related to SciML, I precompile packages very often. I thus have very little benefit of any precompilation, which has lately been wasting 20 minutes multiple times per day.

I just learned that OrdinaryDiffEq is using Preferences.jl to allow the user to opt out of precompilation. Would it be possible to do something similar for SnoopPrecompile globally, using Preferences.jl or an environment variable? I would essentially like to turn off more or less all precompilation, since chances are rather high that I will not benefit from it at all until the next time I perform the same precompilation.

baggepinnen added a commit to baggepinnen/SnoopCompile.jl that referenced this issue Sep 21, 2022
This implements one of the suggestions from timholy#298 and allows the user to opt out of all precompilation by setting the environment variable `ENV["SNOOP_PRECOMPILE"] = false`
@timholy
Copy link
Owner

timholy commented Sep 25, 2022

What happens if you start julia with julia --compiled-modules=no?

@baggepinnen
Copy link
Author

--compiled-modules=no seems to make loading packages extremely slow

/home/fredrikb> julia --startup-file=no --compiled-modules=no 

julia> @time using ControlSystems
┌ Warning: Replacing docs for `SciMLBase.sol :: Union{Tuple, Tuple{D}, Tuple{S}, Tuple{N}, Tuple{T}} where {T, N, S, D}` in module `SciMLBase`
└ @ Base.Docs docs/Docs.jl:240
 81.987430 seconds (132.87 M allocations: 8.530 GiB, 3.21% gc time, 34.21% compilation time: 9% of which was recompilation)
/home/fredrikb> julia --startup-file=no --compiled-modules=yes

julia> @time using ControlSystems
[ Info: Precompiling ControlSystems [a6e380b2-a6ca-5380-bf3e-84a91bcd477e]
 15.364393 seconds (19.27 M allocations: 1.285 GiB, 2.41% gc time, 4.63% compilation time: 48% of which was recompilation)

@timholy
Copy link
Owner

timholy commented Sep 26, 2022

Hmm, yeah, it also nixes the caching of lowered code.

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 a pull request may close this issue.

2 participants