Time to first plot with Makie too long

plotting

#1

I am running the following example using Julia 1.0.2 on a fast Ubuntu quad-core:

using Makie
using GeometryTypes

x = Vec3f0(0); baselen = 0.2f0; dirlen = 1f0
# create an array of differently colored boxes in the direction of the 3 axes
rectangles = [
    (HyperRectangle(Vec3f0(x), Vec3f0(dirlen, baselen, baselen)), RGBAf0(1,0,0,1)),
    (HyperRectangle(Vec3f0(x), Vec3f0(baselen, dirlen, baselen)), RGBAf0(0,1,0,1)),
    (HyperRectangle(Vec3f0(x), Vec3f0(baselen, baselen, dirlen)), RGBAf0(0,0,1,1))
]
meshes = map(GLNormalMesh, rectangles)
mesh(merge(meshes))

It needs 38s to show the plot even after precompiling. It also uses 4.3 GB RAM, which seams to be a lot to me.
Any idea how to improve this time?


#2

https://github.com/JuliaPlots/Makie.jl#precompilation makes it instant last time I checked (v0.6)


#3

Well, I tried it, and it kind of worked: I had to add a lot of packages apart from Makie to make PackageCompiler kind of happy. It would be nice if the list of additionally needed packages would be somewhere documented.

Finally I had to modify the example script like this:

using Makie
using GeometryTypes

x = Vec3f0(0); baselen = 0.2f0; dirlen = 1f0
# create an array of differently colored boxes in the direction of the 3 axes
rectangles = [
    (HyperRectangle(Vec3f0(x), Vec3f0(dirlen, baselen, baselen)), RGBAf0(1,0,0,1
    (HyperRectangle(Vec3f0(x), Vec3f0(baselen, dirlen, baselen)), RGBAf0(0,1,0,1
    (HyperRectangle(Vec3f0(x), Vec3f0(baselen, baselen, dirlen)), RGBAf0(0,0,1,1
]
meshes = map(GLNormalMesh, rectangles)
scene=mesh(merge(meshes))
display(Makie.Screen(), scene)

Not it runs in 12s instead of 38s, which is good enough for me in the moment.
Would not call this instant, though.