I’m developing a Julia-based simulation model that runs from the terminal (no UI). Each time I execute the script, it precompiles all dependencies, which takes quite a long time (around 8 minutes).
Is there a way to keep installed dependencies (e.g., JuMP, Agents) precompiled and cached so that subsequent runs only compile my own modules, rather than recompiling all packages each time? Ideally, I’d like behavior similar to running code from VS Code, where even between sessions it does not recompile everything only the custom modules.
Odd, precompile caching is the default behavior and it is usually only overwhelmed by frequent-enough environment switching. Just to check our terminology here, are you seeing a Precompiling printout each session?
In my experience, frequent precompilation has often to do with code loading from shared environments before activating the actual environment (for example when you load Revise in your startup and activate the env within your script). See also