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

Just an interesting comparison with PackageCompiler Makie speeds v/s official Julia binary Makie speeds:

While using PackageCompiler’s sysimage:

julia> @time using AbstractPlotting
  0.000472 seconds (369 allocations: 20.094 KiB)

julia> @time scatter(rand(10), rand(10))
  0.421506 seconds (151.97 k allocations: 30.967 MiB, 2.72% gc time)
Scene (960px, 540px):
[...]

[new session]

julia> @time using Makie
  0.000343 seconds (819 allocations: 43.156 KiB)
julia> @time scatter(rand(10), rand(10))
  0.487969 seconds (174.73 k allocations: 38.544 MiB, 25.24% gc time)
[...]

versus using the base Julia sysimage:

julia> @time using AbstractPlotting
  4.563567 seconds (7.82 M allocations: 467.765 MiB, 5.14% gc time)
julia> @time scatter(rand(10), rand(10))
 22.975833 seconds (62.87 M allocations: 3.146 GiB, 6.67% gc time)
Scene (960px, 540px):
[...]

[new session]

julia> @time using Makie
 13.146121 seconds (27.27 M allocations: 1.463 GiB, 4.47% gc time)
julia> @time scatter(rand(10), rand(10))
 25.245235 seconds (63.58 M allocations: 3.183 GiB, 6.43% gc time)

It seems from here that Makie takes significantly longer to load compared to AbstractPlotting.

My experience has been that most of the time is in the initial setup. Is it possible that a more detailed or comprehensive precompilation cache (maybe not to the extent of PackageCompiler, but something resembling a compiled library like what GR uses) could alleviate this?

3 Likes