# Time to first plot with Makie too long

**URL:** <https://discourse.julialang.org/t/time-to-first-plot-with-makie-too-long/17947>\
**Category:** Visualization\
**Tags:** plotting, makie, ttfp\
**Created:** [November 24, 2018, 6:13pm UTC](https://discourse.julialang.org/t/time-to-first-plot-with-makie-too-long/17947 "2018-11-24T18:13:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 24, 2018, 6:13pm UTC](https://discourse.julialang.org/t/time-to-first-plot-with-makie-too-long/17947/1 "2018-11-24T18:13:31Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 24, 2018, 6:28pm UTC](https://discourse.julialang.org/t/time-to-first-plot-with-makie-too-long/17947/2 "2018-11-24T18:28:58Z")

</div>

[GitHub - JuliaPlots/Makie.jl: High level plotting on the GPU.](https://github.com/JuliaPlots/Makie.jl#precompilation) makes it instant last time I checked (v0.6)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [November 24, 2018, 7:48pm UTC](https://discourse.julialang.org/t/time-to-first-plot-with-makie-too-long/17947/3 "2018-11-24T19:48:15Z")

</div>

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:

```julia
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.
