Closed XinyuWuu closed 1 month ago
This is just a guess, but could it be that using IJulia causes precompilation invalidations? Did you build the sysimage with IJulia? (If not, does building with IJulia included fix the issue?)
PackageCompiler.create_sysimage([:Gadfly,:DataFrames,:Colors,:Dates,:OhMyREPL,:ColorSchemes,:Distributions,:RDatasets,:Compose,:Random,:CSV,:GLPK,:HDF5,:IterTools,:JSON,:JuMP,:Measures,:RData,:XLSX,:Printf,:Statistics,:CategoricalArrays,:IJulia], precompile_statements_file="compiler_trace.jl",sysimage_path="mysys.so")
It is my build command. I have include the IJulia, but it is still much slower. And I have test not only one piece of code, but more ploting code, so I don't think it is a guess.
IJulia did not causes precompilation invalidations, it runs faster than before(without precompiled sysimage), but it is much slower than terminal.
I think IJulia definitely slow down the speed in some way, but I don't know the reasons.
I think you also need precompile display
function that is used by IJulia.
My repository https://github.com/terasakisatoshi/sysimage_creator will help you.
It will reduce time to initialize Jupyter Kernel and plot for the first time. Have a try.
This can be closed.
When I use IJulia with a costom sysimage created by PackageCompiler.jl, the code runs much slower.
my kernel:
my test code:
When in the terminal it runs extremely fast, but in the notebook, it takes 12s. In both case the code is the first time been executed.