Roadmap for a faster time-to-first-plot?

Hmm. I get much better results with the “package compiled” Plots version:

% julia -J /usr/local/lib/julia/packages/PackageCompiler/CJQcs/sysimg/sys
julia> @time using Plots; gr(); display(plot(randn(10)))
  0.000909 seconds (1.24 k allocations: 61.531 KiB)

julia> versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_DEPOT_PATH = /usr/local/lib/julia:
  JULIA_HISTORY = /Users/jheinen/.julia/logs/repl_history.jl

(v1.3) pkg> st Plots
    Status `/usr/local/lib/julia/environments/v1.3/Project.toml`
  [53c48c17] FixedPointNumbers v0.6.1
  [28b8d3ca] GR v0.46.0 #master (https://github.com/jheinen/GR.jl.git)
  [77ba4419] NaNMath v0.3.3
  [ccf2f8ad] PlotThemes v1.0.1
  [995b91a9] PlotUtils v0.6.2 #master (https://github.com/JuliaPlots/PlotUtils.jl.git)
  [91a5bcdd] Plots v0.28.5 #master (https://github.com/JuliaPlots/Plots.jl.git)
  [3cdcf5f2] RecipesBase v0.7.0 #master (https://github.com/JuliaPlots/RecipesBase.jl.git)
  [992d4aef] Showoff v0.3.1 #master (https://github.com/JuliaGraphics/Showoff.jl.git)
  [2913bbd2] StatsBase v0.32.0

I use snoop-Plots.jl as a workload for Plots.jl.

5 Likes

If you have trouble with the above workload script (on macOS), you probably have to comment out the StatsPlots test in the end. See note from @ianfiske

Did anything come out of this yet? Any tooling for more precisely identifying why inference/compile-time is slow?

Lots of things. We noticed the Plots.jl time actually goes to around 5 seconds with -O0, so we were underestimating the LLVM time and that means there’s more to do there. It’s somewhat hard to benchmark because the issues now that precompile files have been enhanced are mostly about method invalidation: someone defines a lower dispatch that “infects” that suddenly causes a lot less precompile to be reused. A big issue in CSV.jl was noted to be due to that, and that’s really where all of the profiling seems to lead. Some of that could be fixed by moving some more of these basic dispatches to Base.

10 Likes

Sounds great! Where could I follow the progress or discussions? I didn’t find anything recent.

Come to Boston :slight_smile:! A lot of this is just developing daily. and things get online as they get more concrete.

I’d love to but there are ~6000km and a big ocean in the way. I guess I’ll just have to be patient then :smile:

6 Likes

It’s such a long post! I lost the point. Is there a roadmap?

We’re mostly already there

2 Likes

For the record, @jzr mentioned a while back in another post the SandDance extension for VSCode. If Julia code writes the data to be plotted to disk as a CSV file, a right click to view it in SandDance is instantaneous. Yes, the number of plot types is limited, but powerful for some applications.

using DelimitedFiles
x = 0:0.1:2π
y = sin.(x)
open("delim_file_4_sanddance.csv", "w") do io
    writedlm(io, ["X" "Y"], ',')
    writedlm(io, [x y], ',')
end

It would be handy to have a sandance function available: sanddance.view(filename)

6 Likes

I started a Julia wrapper at some point: https://github.com/queryverse/SandDance.jl. But it is not well maintained, not sure whether it even works at all right now…

6 Likes

@davidanthoff, SandDance.jl works pretty well (Win10, Julia 1.7). The time to first plot seems to be < 2 s for small datasets and about 4-5 s for ~10K points. Thank you.

# pkg> add  https://github.com/queryverse/SandDance.jl
using SandDance, DataFrames
f(x,y) = exp(-x^2*y^2)*sin(x*y)
n = 100
x = y = LinRange(-π, π, n)
xx = x' .* ones(n)
yy = ones(n)' .* y
zz = f.(xx,yy)
data2d = DataFrame(x=xx[:], y=yy[:], z=zz[:])
SandDanceWindow(data2d)

10 Likes