Julia 1.9: disable pkgimages? #2453
Replies: 6 comments 1 reply
-
If we're doing a docker build prior to the binder, or if we anticipate the docker build to be cached, then we won't have this effect, IIUC, and it will be net positive with having this flag on. |
Beta Was this translation helpful? Give feedback.
-
... I think this is quite serious, as the first time experience with Julia/Pluto plays as big role with acceptance. So switching code caching off by default appears to make sense. May be one could also add a "restart with precompiled packages" button at the top with some informative help text. Also, for the featured notebooks there probably could be boxes to be ticked which tell in which mode to start a particular notebook. |
Beta Was this translation helpful? Give feedback.
-
From a teachers perspective, I'd rather see a different solution to this problem. My students will open a dozen notebooks for my course. The packages used in the notebooks are very similar. I'd rather have tooling to "harmonize" the package environments across notebooks. Then students pay the precompilation costs just once for the whole course. Also, I hope that students will run each notebooks more than once. So pkgimages might make sense for them anyways. |
Beta Was this translation helpful? Give feedback.
-
Concerning
I think it's fine to special-case binder. But I think different behavior depending on how a user starts a notebook locally would be kind of confusing. Why not ask the user about the preferred mode before starting a notebook? Probably one can allow the creator of a notebook to specify a suggested mode in the notebook metadata. (So that teachers can recommend using pkgimages, and writers of tutorials can recommend not using them) |
Beta Was this translation helpful? Give feedback.
-
Concerning tooling, it is already kind of possible to modify the notebook env programmatically, see e.g. here. If I have the same |
Beta Was this translation helpful? Give feedback.
-
Julia 1.9 does more caching to improve TTFX times, but unfortunately, this has blown up precompilation times, making them 2x-4x longer for some packages like Plots, CSV, Unitful, Turing, OrdinaryDiffEq. The increases in precompilation times are much larger than the reductions in TTFX.
For some Julia workflows, this trade-off makes sense (install your favourite packages in the global environment, update once per week). But when launching notebooks from the web, or running the featured notebooks, this can easily double the loading time of every notebook that you run. 😭
Slow notebook launches is already a common complaint of Pluto, and this will make it much worse. It especially affects new users, and people who are trying out Pluto for the first time.
Note about caching Pluto vs everything else
In this post, I am not talking about the caching of the Pluto.jl package (the Pluto server), but everything you do inside your notebooks: Plots, CSV, HypertextLiteral, etc.
Disabling
The new feature can be disabled using a command line flag: https://github.com/JuliaLang/julia/pull/47184/files#diff-13226b5257c7f20f65574085f06b3bea204a8c54d0aa37fd76bd9eda3c950500R105 This affects both loading (no
.dylib
files are loaded by julia) and Pkg precompilation (no.dylib
files are generated, precompilation is fast again).We control the command line flags of the notebook processes that we launch, so we can enable/disable pkgimages for notebook processes, regardless of the settings used to start the Pluto server (i.e. the REPL where you run
Pluto.run()
).👀 We still need to figure out how to disable pkgimages during
Pkg.precompile()
, as this currently happens on the Pluto server. We could start a new process dedicated to precompilation, so that we control the command line args. We could also open a PR to Pkg.jl to add a keyword argument to control this behaviour.Idea
We should definitely disable it for the integrated binder button (powered by https://github.com/fonsp/pluto-on-binder ), because this will run a notebook exactly once, so the new caching mechanism has a negative effect.
Perhaps we should also disable pkgimages when you:
Finally, we could disable pkgimages for all notebooks by default, and only enable it if the same notebook file is run a second time.
Beta Was this translation helpful? Give feedback.
All reactions