Following the instructions for creating a Plots.jl sysimage, I was able to reduce my load time significantly:
time julia -e "using Plots; p = plot(rand(5), rand(5)); display(p)"
23.78s user 0.75s system 75% cpu 32.647 total
time julia --sysimage sys_plots.so -e "using Plots; p = plot(rand(5), rand(5)); display(p)"
0.41s user 0.20s system 67% cpu 0.908 total
Are you plotting in the terminal, or Atom/VSCode? If it’s the latter, try this workaround. IDEs require extra machinery to display plots, and PackageCompiler needs to see that machinery if it’s to be compiled into a sysimage.
The docs explain that one of the main downsides of using PackageCompiler is that you cannot up a package that’s included in the sysimage anymore, i.e. it is frozen at whatever version you included in the image.
using PackageCompiler
create_sysimage(:Plots, sysimage_path="sys_plots.so", precompile_execution_file="precompile_plots.jl")
I get:
ERROR: UndefVarError: create_sysimage not defined
Stacktrace:
[1] top-level scope at REPL[5]:1
Some changes in the API ? (I installed PackageCompiler v0.6.5)
EDIT: I see that PackageCompiler is at v 1.1… I just added to a Julia1.3 instance today, it installed the v0.6.5 not the v1.1…
How can I know what is it blocking the installation of the latest version ?
Okay, then you are in the territory of invalidations (see https://github.com/JuliaLang/www.julialang.org/pull/794 for a WIP blogpost about this exact problem). My guess is that this will have quite a bit of focus in the upcoming months so hopefully should improve.