Long startup time when loading Plots.jl


#1

Hey Guys,

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 :slight_smile:


#2

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.)


#3

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>

#4

It’s slow, but i guess it depends on what CPU do you have?

edit - wrong time tested. Plots was already loaded by juliarc.jl file.

here’s the correct time.

julia> @time using Plots
  1.265920 seconds (910.47 k allocations: 39.595 MB, 8.20% gc time)

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) CPU E5-4650 v3 @ 2.10GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

#5

I think you are in the right ballpark now,… or I am doing something wrong as well

julia> @time using Plots
  4.781873 seconds (4.08 M allocations: 178.985 MB, 5.21% gc time)

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: liblapack.so.3
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

#6

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.


#7
julia> @time using Plots
6.304087 seconds (4.23 M allocations: 182.704 MB, 3.63% gc time)

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: liblapack.so.3
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

so thats normal then? any plans to reduce that?


#8

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.


#9

okay thank you all. Glad I could clarify that :slight_smile:


#10

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.