This shouldnāt be the case. As you see in the output 219 already precompiled, most changes should only incur an incremental precompilation cost. In my experience Plots is a bit of an issue here in that it has loads of dependencies so if you change something in the environment which affects one of its dependencies that will recompile Plots which as you say is probably the biggest driver - and having both Plots and StatsPlots doesnāt help (you probably donāt need that as StatsPlots reexports Plots).
EDIT scratch that last bit, StatsPlots would have Plots as a dependency anyway, so I guess whether they are both in the Project.toml or not doesnāt make a difference.
I guess you nailed the problem. It does not recompile everything each time, but it looks like every change i made (add a pakcgae, remove one, update another one, or anything related) instantly triggers a few other packages precompilation, but almost every time including Plots.jl, the most problematic oneā¦
Is there a way i can tell Julia to NOT recompile Plots.jl ? Maybe by āpinningā its version and its dependencies versions somehow ?
Better yet: is there a way I can tell it to re-do as little as possible ? Say I install a given new package, the default behavior i want is to chose the version of this new package to disrupt at least as possible the current environement state and thus trigger less precompilation. Say I update a given package, well same idea: keep compat bounds tight to avoid as much as possible work. Say I remove a package, well NOTHING should be updated. I would love such a āconservativeā mode.
@Amval I am on 1.9.3, Iāll give a versionInfo once my current run is finished. I thought of updating to 1.10, but for the very reason I am posting this today i did not ^^
Edit: done abit of reading around, and found out this thread
and then this PR :
Looks like others were having this kind of issues before me Now i just have to understand how to use these new functionalities to solve my issueā¦
The docs on pinning a package version. Of course you have to keep in mind that pinning that package also restricts other packages indirectly because of dependency compatibility. Pkg.add also has settings for version resolution but Iāve nevered changed the default because the rest sound intimidating.
6 minutes does seem like a lot, over 4 of it is parts of Plots. It is a hefty package so maybe this isnāt actually unusual.
I also get Plots precompiled sometimes up to 10 times per day, but it usually takes less than 30 seconds for me, so 70% of 6 minutes still sounds like a lot
I am not sure pinning Plots.jl is enough: if one of its dependency is changed (within compat bounds) it will still precompile Plots.jl again right ?
I think what I want is PRESERVE_TIERED_INSTALLED. The docs says
To change the default strategy to PRESERVE_TIERED_INSTALLED set the env var JULIA_PKG_PRESERVE_TIERED_INSTALLED to true.
Do someone know how i can setup this environement variable globally on my machine (windows machine) ?
Indeed, maybe there is a reason mine takes so longā¦ but i do not know which one. Might be related to the frequency of re-precompilation ? or to the number of stuff in the env ? dunno.
@nilshg suggests building a sysimage with Plots.jl in it.
I am not clear on the differents ups and downs of the four approachesā¦
I dont thing option 4 is the way to go as there is not only Plots.jl but i want a more general behavior, and I do not want to freeze stuff, I want to be able to update packages if i ask for it (so option 3 is probably the way to go)
After reading PkgHelpers.jl docs it looks like freeze() will add stuff to compat entries of the project, so option 1 looks a bit invasive to my tasteā¦
I am not understanding correctly what option 2 really does. Maybe 2+3 is the right call for me ?
As I understand it 2 basically tells Julia not to update the general registry. This is often the source of āunnecessaryā precompilation in the sense that some dependency of a dependency of a dependency of Plots releases some patch release, causing recompilation of the entire Plots stack.
Iād recommend just doing 3 in your .julia/config/startup.jl
ENV["JULIA_PKG_PRESERVE_TIERED_INSTALLED"] = true
Iāve been running with that since 1.9 came out and I havenāt seen any issues.
The reason itās not the default is that some were concerned that it would mean users would generally get stuck on older package versions, but that hasnāt been a noticeable issue for me.