# Compiling a project specific sysimage

**URL:** https://discourse.julialang.org/t/compiling-a-project-specific-sysimage/47902
**Category:** Tooling
**Tags:** precompilation, package-compiler, sysimage
**Created:** [October 6, 2020, 11:20pm UTC](https://discourse.julialang.org/t/compiling-a-project-specific-sysimage/47902 "2020-10-06T23:20:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![martenlienen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martenlienen/32/18572_2.png) [@martenlienen](https://discourse.julialang.org/u/martenlienen)
#### Post date: [October 6, 2020, 11:20pm UTC](https://discourse.julialang.org/t/compiling-a-project-specific-sysimage/47902/1 "2020-10-06T23:20:53Z")

</div>

I am getting started with Julia and having a good time. One thing I dislike quite a bit though is the slow startup time of a REPL when you import some costly packages in the beginning. As far as I can tell the best way to work around this is to compile a custom sysimage with PackageCompiler.jl which I did. It works great for some packages like Plots.jl but others refuse to be precompiled and if you try, the sysimage segfaults on load. Instead of fixing the root cause, I decided to write a script that still allows me to precompile as many things as possible anyway.  
[https://gist.github.com/cqql/d4ab84617a8e532dc0cedcd5469fb715](https://gist.github.com/cqql/d4ab84617a8e532dc0cedcd5469fb715)  
It lists a project’s dependencies and then compiles them one by one incrementally into a sysimage, checking at each step if the image still loads.

Is there a better/established way to go about this that I missed? As I am still learning the language, is there code in the script that could be written more idiomatically?

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [October 6, 2020, 11:55pm UTC](https://discourse.julialang.org/t/compiling-a-project-specific-sysimage/47902/2 "2020-10-06T23:55:51Z")

</div>

Note that all parts of this are getting better in 1.6. Startup times are noticeably faster, and precompilation works better.

---

<div class="post-metadata">

### Author: ![martenlienen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martenlienen/32/18572_2.png) [@martenlienen](https://discourse.julialang.org/u/martenlienen)
#### Post date: [October 7, 2020, 7:42am UTC](https://discourse.julialang.org/t/compiling-a-project-specific-sysimage/47902/3 "2020-10-07T07:42:49Z")

</div>

I read the blog post on invalidations and can’t wait for the release of 1.6! Do you think custom sysimages will still be useful or required?
