# PackageCompiler: enable --trace-compile for Jupyter session

**URL:** https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364
**Category:** General Usage
**Created:** [October 14, 2020, 1:26pm UTC](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364 "2020-10-14T13:26:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [October 14, 2020, 1:26pm UTC](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364/1 "2020-10-14T13:26:31Z")

</div>

I am using Jupyter notebook with `Interact` and `Makie` for displaying widgets and plots and I would like to quicken the startup time.  
I already compiled a sysimage with `Makie` and it’s getting better, but displaying a scene for the first time still takes ~40s. I tried using a precompilation file where I call one of the `Makie` plot functions, but I didn’t get much improvement. (I cannot add `Interact` to the sysimage because widgets will not work, I think some `WebIO` functionality gets broken).  
I think that for better startup time I need to catch the compilation statements used for `WGLMakie` (for displaying in a web based environment), but I don’t know how to pass `--trace-compile` when I start the Jupyter notebook from REPL, since the Jupyter kernel is different from the session from which I call `notebook()`.  
Any ideas? Thank you.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [October 14, 2020, 1:37pm UTC](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364/2 "2020-10-14T13:37:10Z")

</div>

> [@Iulian.Cioarca](#):
>
> Any ideas? Thank you.

You could install a new kernel ([Installation · IJulia](https://julialang.github.io/IJulia.jl/dev/manual/installation/#Installing-additional-Julia-kernels)) that has e.g. `--trace-compile=ijulia_precompile.jl` as one of the arguments. Then you can run a session and record stuff to that file.

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [October 15, 2020, 11:28am UTC](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364/3 "2020-10-15T11:28:00Z")

</div>

Thank you! I used your suggestion and generated ~ 3600 precompile statements. In the beginning most of them errored because they are related to modules not directly imported(but used by `Interact` and `Makie`). I added all needed packages and managed to precompile most of the statements, apart from a few which still errored (due to some `Symbol("#5454")` not defined). Is adding all the packages the right way to precompile?

After using the precompilation file in the sysimage I roughly cut in half the initial run time(20s). This is a good improvement, but I suspect there is more compilation going on.

I’m not familiar with the Julia/PackageCompiler internals, so I would seize this occasion and ask an additional question: Is PackageCompiler + precompile\_file adding machine code or just inference results to the sysimage?
