JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

Is `create_sysimage_workaround` still needed? #839

Open sloede opened 1 year ago

sloede commented 1 year ago

According to the associated comment, https://github.com/JuliaLang/PackageCompiler.jl/blob/7f0607c990003099969f449c28ad2aeffd0671f4/src/PackageCompiler.jl#L1047-L1050 the function create_sysimage_workaround should not be necessary anymore once https://github.com/JuliaLang/julia/pull/37530 has been merged (which it was, approximately 2 years ago).

Since it seems like this workaround increases compile times, is it time to retire the workaround? Or is it still needed and only the comment needs updating?

visr commented 1 year ago

PackageCompiler still supports julia 1.6, and https://github.com/JuliaLang/julia/commit/4170090765435726c9b81fa0236e256a4062b7a9 needs julia 1.8 as far as I can tell.

I haven't measured the increased compile times, but if it is significant, perhaps we can only do the empty sysimage creation on older julia versions.

sloede commented 1 year ago

I used PackageCompiler.jl to compile a small test library with the current master including the workaround, and a variant that directly calls create_sysimage. To achieve the "plain" approach, I modified create_sysimage_workaround to directly jump to the call create_sysimage (source), with incremental=false set.

With this, I get the following times on my Linux workstation:

It seems like the plain approach requires 20s more for the initial base system image, plus precompilation takes 30s longer. How is this even possible that the workaround is faster than the plain approach - am I doing it wrong? And if I am not doing it wrong, should the workaround really be the preferred approach, since it seems to be faster (not by much, but consistently on my machine)?