JuliaLang / PackageCompiler.jl

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

revert() leads to slower system image #208

Closed arnavs closed 4 years ago

arnavs commented 5 years ago

I apologize if this is fuzzily-stated or setup-specific. I've done my best to describe below.

Initial Baseline

arnavsood@mbp:~$ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz

arnavsood@mbp:~$ time julia -e "x = 2"
real    0m0.168s
user    0m0.109s
sys 0m0.069s

PackageCompiler Stuff

(v1.1) pkg> dev PackageCompiler
# dev stuff 

julia> using PackageCompiler

julia> compile_package("Plots", force = true)
# compilation stuff 

julia> revert()

Regressed Performance

arnavsood@mbp:~$ time julia -e "x = 2"
real    0m0.673s
user    0m1.023s
sys 0m0.214s
SimonDanisch commented 5 years ago

Yeah, so I haven't updated this path of PackageCompiler yet - so it builds a system image from scratch, which is missing precompile statements from the base image. If you build julia yourself, the easiest way to get back the old image is to run make again, and otherwise just re-download julia and take the image from there ;) For the future I'd just use compile_incremental which builds upon the "fast" system image.

arnavs commented 5 years ago

Gotcha. I'll give that a try, thanks. I've been using the downloaded binaries like you suggest.

Should I close this? Or do you want to leave it open until you do the updates

SimonDanisch commented 5 years ago

I won't do any updates on this, since I'm pretty swamped :D anyone is welcome to fill a pr for this, should be relatively easy to improve the current behavior.

arnavs commented 5 years ago

OK, I’ll give it a shot.