How to make a fast first plot with CairoMakie?

I’m new to Julia language.
I have tried to follow data visualization with Makie.

However, the time to first plot is too long. (~50sec)
50.087309 seconds (146.21 M allocations: 7.676 GiB, 3.69% gc time, 98.74% compilation time: 0% of which was recompilation)
I know it is due to compilation process. And actual rendering time is about 150ms.
What should I do to reduce the time to (first) plot??

You might want to try Julia 1.9 (currently in beta).

To elaborate on the previous answer, Julia 1.9 allows “native code caching”, which makes Time To First X (TTFX) significantly faster in many cases.

An alternative is to make a system image. It is a little cumbersome, but gives the largest reduction in TTFX. See the vscode-guide to sysimages, and the PackageCompiler.jl page on sysimages for more information about the sysimage approach.

But I would generally recommend a new user to just use 1.9 beta (Easy to upgrade if you use a Julia installer system juliaup or jill.py), or wait until the non-beta release to have the problem significantly alleviated. As 1.9 is in the third beta release, I do not think it is many week away.

1 Like