Re:Statistics with Julia [pdf]
by improbable22 on Friday July 12, 2019 @11:49AM
(#20421567)
While this probably isn't a practical way to do any real work, running it with --compile=min gives some idea what might be possible soon:
$ julia --compile=min -e '@time (using GR; plot(rand(20)))'
0.375836 seconds (368.83 k allocations: 20.190 MiB, 1.65% gc time)
$ julia --compile=min -e '@time (using Plots; plot(rand(20)))'
4.302867 seconds (6.41 M allocations: 371.485 MiB, 5.07% gc time)
Re:Statistics with Julia [pdf]
by ViralBShah on Friday July 12, 2019 @04:45PM
(#20424341)
The time to second plot will be a few milliseconds, in the same process - in the same Julia session. So, while the time to first plot is frustrating, it is ok if your interactive session times are longer.
Of course, we continue to work on improving compile times. About half of the time is spent in LLVM compilation, which has actually become slower over time.
What prevents the plot compilation from being pre-compiled at install?
The Plots package adds a significant overhead right now. Try using PyPlot (matplotlib) directly. These days you can use exactly the same syntax (dot-call) as in Python.
$ time julia -e "using PyPlot;x=1:10;y=rand(10);plot(x,y);"
real 0m5.676s
Take, for example, a simple program that creates a line plot (https://docs.juliaplots.org/latest/tutorial/):
After installing the package, the first run has to precompile(?), and subsequent runs use the package cache. But ~25 s to create a simple plot is incredibly slow and frustrating to work with.