# \[ANN\] SimplePlots.jl – Interactive Plots in 4 seconds or your money back

**URL:** <https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903>\
**Category:** Package Announcements\
**Tags:** plotting, notebooks\
**Created:** [May 21, 2020, 6:22pm UTC](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903 "2020-05-21T18:22:53Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [May 28, 2020, 10:42pm UTC](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903/21 "2020-05-28T22:42:39Z")

</div>

> [@joa-quim](#):
>
> But we don’t want to start Julia with `-O0` just to make _TTFP_ look low, do we?

That’s why the three-line addition to your package (what I was referring to with “can be achieved partially with a PR to the package”), is important (works for 1.5 or later, does nothing on earlier):

> <https://github.com/JuliaPlots/Plots.jl/commit/6807f53a7e00098bdc7a56600155b054f7a7e1e9>

But you might be surprised how effective -O0 or -O1 can be, I’ve found a benchmark that benefited from it (so don’t dismiss it until you’ve tried):

[https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/pidigits-julia-3.html](https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/pidigits-julia-3.html)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [July 5, 2020, 11:28pm UTC](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903/22 "2020-07-05T23:28:28Z")

</div>

> [@joa-quim](#):
>
> we don’t want to start Julia with `-O0` just to make _TTFP_ look low, do we?

There’s not always a trade-off. Sometimes it’s just a win-win, why my PR for JLL packages was finally merged, and they all will use `-O0`, but I’m told they all first need to get a new version out to trigger code generation.

See: [GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl](https://github.com/JuliaPackaging/Yggdrasil)

Anyway if you want fast plotting with default settings:

```julia
(@v1.6) pkg> add GR#master # there's a performance regression for using for latest version, and I filed an issue, and it's fixed on master

julia> @time using GR
  0.221278 seconds (68.59 k allocations: 5.280 MiB) # the author claims 0.17 sec, maybe it's with non-default settings

and FYI:
$ julia --startup-file=no -O1

julia> @time using GR
  0.150216 seconds (68.59 k allocations: 5.280 MiB)

```

The non-first plot shouldn’t be slower, even with `-O1`, as the heavy lifting is done by a native code precompiled library, and the same would apply for all JLL packages. My PR (at BinaryBuilder.jl) to default to -O0 for JLL packages, was finally merged to speed up loading (`using`) those packages. But the rest of your code will be affected by non-default settings used (globally or locally in modules, as of 1.5). With more JLL packages, we’re up to 441 JLL package, we’ll have more of a Python feeling, best of both worlds:

E.g. already got the treatment:

```julia
julia> @time using LibPQ_jll
  0.404593 seconds (366.31 k allocations: 21.175 MiB, 2.87% gc time)

still the main package (as it as other slow dependencies, not yet JLL):

julia> @time using LibPQ
  9.215787 seconds (16.41 M allocations: 834.362 MiB, 4.51% gc time)

with -O0:

julia> @time using LibPQ
  6.377934 seconds (16.41 M allocations: 834.320 MiB, 6.54% gc time)

```

For some reason `-O0` is also used for Python 3 code, which actually beats the Julia code (we need to look into that):

[https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-python3-2.html](https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-python3-2.html)

---

<div class="post-metadata">

**Author:** ![rkurchin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rkurchin/32/16039_2.png) [@rkurchin](https://discourse.julialang.org/u/rkurchin)\
**Post date:** [July 29, 2020, 9:21pm UTC](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903/23 "2020-07-29T21:21:27Z")

</div>

cross-posted from [this issue](https://github.com/djsegal/SimplePlots.jl/issues/7):

Does the @demo macro work with CompositePlots? I’d like to have some sliders that affect two plots at once but I can’t figure out how to get both of them to show up…see issue linked above for what I’ve tried.

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [July 30, 2020, 4:11am UTC](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903/24 "2020-07-30T04:11:08Z")

</div>

feel like paying $8…

[Previous page](https://discourse.julialang.org/t/ann-simpleplots-jl-interactive-plots-in-4-seconds-or-your-money-back/39903.md?page=1)
