Comparition of timing v1.9 vs v1.8 and how to get this precompilation in my own packages?

Just tested Julia v1.9rc3 and compared the timining to first plot with Julia 1.8 on a terminal under a new temporary project environment:

Command Julia 1.9rc3 Julia 1.8
add Plots 2’ 32’’ 1’ 22’’
using Plots 3’’ 6’’
plot (x->x^2) 1’’ 7’’

Is this heavy precompilation coming automatically or does it need to be somehow enabled in the package ? How to do it while maintaining compatibility with pre-1.9 Julia versions ?

it should be done once. 1.9 saves more precompiled code

In general, yes, using PrecompileTools.jl

2 Likes

yep, just tried on my unmodified package, julia 1.9 is about twice as fast to run the first call to my functions, but not 7 times faster as in Plots.jl… going to look, thanks…

Yes, getting a fast runtime performance also often requires fixing invalidations that might exist in a package (see Snooping on and fixing invalidations: @snoopr · SnoopCompile), as well as improving type-inference by avoiding code patterns such as recursions involving changing types, which seems to trip the compiler

2 Likes