I’m new to Julia, and I’m excited at the Control Systems design capability! I’m using macOS Catalina on a late 2013 MacBook Pro (2.4 GHz duel-core i5).
I understand the initial startup will take longer than subsequent startups due to just in time compiling, and other concepts I don’t fully understand! But I’m finding extremely long pre-compile times when loading ControlSystems.jl. Is this typical, or an indication that something is wrong? It’s odd to me that the package requires 1.418 GiB, is that typical for packages?
julia> @time using ControlSystems
[ Info: Precompiling ControlSystems [a6e380b2-a6ca-5380-bf3e-84a91bcd477e]
139.132995 seconds (26.78 M allocations: 1.418 GiB, 0.37% gc time)
I know this is a basic question, I’d appreciate someone pointing me in the right direction!
Hello and welcome to the community! Which versions of Julia and Controlsystems.jl are you using? The precompile time can be quite long, in particular if you haven’t previously precompiled Ordinarydiffeq.jl
Thank you! To check my understanding, is 1.1418 GiB the amount that each package keeps in memory after using Package? Or is that memory unallocated after loading. Seems like the memory is unallocated.
Yep, everything seems to be up to date. Hopefully you’ll only experience the precompilation once, and subsequent uses of the package should be snappier (until it is updated, when you have to precompile again).
Thanks for the help, that makes sense. Last question - I need to precompile every time I start Julia, is that the right workflow? I see PackageCompiler.jl can save those package binaries for use next time I start Julia, but to clarify, without PackageCompiler.jl you need to pre-compile package with every new Julia instance?
It should only recompile once and then never again until the package or one of its dependencies is updated. Did you perhaps update any package since the last precompilation? Or did you get a warning message during the precompilation?
I am not sure if you are aware, but I really recommend you looking into: Revise.jl, jupyter notebooks, or Pluto.jl (which one depends on your workflow) to avoid having to load such packages frequently.
I use Jupyter notebooks for data analysis. I load a notebook in the morning, and work in there for the whole day, so I only pay the price for loading, one time, while I am eating breakfast. If you declare many new structures it may not be viable however.