make first call faster


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?

Lithuanian University of Health Sciences


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.


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

julia> VERSION

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)


julia> VERSION

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.