PackageCompiler best practice?

How are you all using PackageCompiler?

Without it I’m looking at “time to first plot” like this:

julia> using DataFrames, StatsPlots
julia> df = DataFrame(a = 1:10, b = 10 .* rand(10), c = 10 .* rand(10));
julia> @time @df df plot(:a, [:b :c], colour = [:red :blue])
151.376876 seconds (80.14 M allocations: 4.842 GiB, 1.34% gc time)

Is it better to have different system images for different packages or just always replace the default image?

I know there is not a simple answer, but I’m looking for advice on what works well for you.

I’ve been using the Julia VS Code extension’s feature to build a sysimage for a given project (run task -> build image). It just generates a sysimage with the packages in the project’s environment and stores it in the project folder. Then when you run “start REPL” it automatically uses the sysimage. It’s pretty handy but you could definitely do the same without VS Code, and just using a script to do the same.

I like having it per project because you need to regenerate it if you want to update packages, and Julia startup time increases the bigger it is, so having one giant sysimage with all the packages you ever use doesn’t seem ideal (more packages means you might need to regenerate it more and also Julia starts slower).

1 Like