I’m new to Julia and also programming in general. I’m checking out Julia as an alternative to python for scientific purposes. So I was wondering what’s up with my super long startup times. I also did a reddit post concerning this issue.
If I import modules into Julia with using Plots or using DataFrames for example, it takes really long time for Julia to evaluate. Here is a Screenshot of what I mean. Any method to get around this problem? Is this a general problem of the language or is there something wrong with my machine? Please ELI5 cause I’m a beginner
The first command shows that DataFrames is being precompiled, just as if it was the first time you loaded that version of the package. What do you get the second time you call it? (BTW, better copy/paste output into code blocks instead of posting screenshots.)
Yes the second time is actually faster. Plots still needs about 6 seconds, so I don’t know if this is normal. People on reddit said they need under 1 second on old macbooks.
julia> @time using DataFrames
0.181359 seconds (405.94 k allocations: 21.286 MB)
julia> @time using Plots
6.304087 seconds (4.23 M allocations: 182.704 MB, 3.63% gc time)
julia>
Plots.jl is no longer being precompiled due to its use of packages that are not being explicitly required (precompilation can then lead to errors). This means that it, unfortunately, will have a quite long loading time. I typically have a REPL or IJulia session with Plots loaded all the time to plot data so it doesn’t really bother me.
Yes, there are many plans to reduce this via extern (conditional) modules. As of right now, the conditional usage of packages used by Plots is not supported by Julia itself, and so the way it’s implemented is not compatible with precompilation.
One thing I usually do is to simply put using Plots in my .juliarc.jl file. Mainly because I use this package really often. So, I never really notice the time it takes.