PackageCompiler.jl
PackageCompiler.jl copied to clipboard
Is `create_sysimage_workaround` still needed?
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?
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.
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:
- with workaround:
[02m:17s] PackageCompiler: compiling base system image (incremental=false)[02m:52s] PackageCompiler: compiling nonincremental system image[00m:06s] Precompiling project...[01m:16s] PackageCompiler: compiling incremental system image- Total:
7m:45s
- without workaround ("plain"):
[02m:33s] PackageCompiler: compiling base system image (incremental=false)[00m:36s] Precompiling project...[03m:14s] PackageCompiler: compiling nonincremental system image- Total:
7m:50s
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)?