make first call faster

#1

Hello, I just started using Julia, I noticed that commands
using Plotly plot(rand(10))
perform slowly ~30s in first run, but faster ~2s in second run.
Could it be possible to cache that process to make it fast after Julia restart?

Kestutis,
Lithuanian University of Health Sciences

#2

Hi @KestutisMa, welcome to Julia’s forums. Yes, we’re aware that time-to-first-plot is a major problem. It is being worked on and is one of the top priorities for compiler work:

Compiler latency has already been improved significantly in Julia 1.1 and will be much better in the upcoming Julia 1.2 release.

9 Likes
#3

Hi Stefan, could you give some more details about those upcoming improvements? Don’t see them mentioned in the NEWS.md on master, and I just tried

julia> VERSION
v"1.1.0"

julia> @time using PyPlot
  3.730215 seconds (7.85 M allocations: 410.184 MiB, 3.51% gc time)

julia> @time plot(rand(10))
  0.536229 seconds (1.48 M allocations: 74.613 MiB, 2.85% gc time)

vs

julia> VERSION
v"1.2.0-DEV.663"

julia> @time using PyPlot
  3.732857 seconds (7.53 M allocations: 393.297 MiB, 4.65% gc time)

julia> @time plot(rand(10))
  0.954086 seconds (3.75 M allocations: 187.505 MiB, 11.52% gc time)

which makes me think that these improvements are not in master yet. Thanks in advance.