# Will Julia ever fix its "using ..." latency problems?

**URL:** <https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659>\
**Category:** Performance\
**Created:** [November 23, 2020, 11:57pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659 "2020-11-23T23:57:55Z")\
**Posts on this page:** 1\
**Showing post:** 93

<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:** [April 25, 2022, 1:52pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/93 "2022-04-25T13:52:05Z")

</div>

@Volker_Weissmann DifferentialEquations is a bit unfair, but also getting a lot faster.\*

Several plotting packages have sub-sec. startup (but I’m otherwise checking same packages you did/the abstraction plotting packages; what are comparable package/s in Python, i.e. with backends?):

```julia
julia> @time using PGFPlotsX
  0.413068 seconds (464.33 k allocations: 29.720 MiB, 10.62% compilation time)

same plotting package you get with Plots.jl, without the abstraction:

julia> @time using GR
  0.815509 seconds (819.21 k allocations: 47.663 MiB, 1.71% gc time, 86.12% compilation time)

```

> [@Fastest plotting library?](https://discourse.julialang.org/t/fastest-plotting-library/62018/48):
>
> If using PGFPlotsX for multiple figures, make sure you are not generating one figure per pdf but instead put multiple figures into the same pdf. As an example: x = range(-1; stop = 1, length = 51); axises = [@pgf Axis( { xmajorgrids, ymajorgrids, }, Plot( { no\_marks, }, Coordinates(x, 1 ./ (x.-i)) ) ) for i in 1:10]; @time for (i, axis) in enumerate(axises) pgfsave("file\_$i.pdf", axis) end # ~ 5 seconds td = TikzDocument…

> [@tbeason](#):
>
> To be fair you’ve picked out like the worst of the worst here. Most packages have rather small load times.

There’s been good progress made from 12.7 sec (on your machine), now 70% faster (on my loaded machine, compared to yours):

```julia
in 1.9-DEV:

julia> @time using Plots
  3.871938 seconds (5.66 M allocations: 393.934 MiB, 4.29% gc time, 22.05% compilation time: 0% of which was recompilation)

after:
[Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
 80.083775 seconds (5.59 M allocations: 389.394 MiB, 0.21% gc time, 1.14% compilation time: 0% of which was recompilation)

vs in 1.7.0:

julia> @time using Plots
  6.400478 seconds (9.10 M allocations: 642.353 MiB, 5.92% gc time, 20.97% compilation time)

[Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
151.895940 seconds (9.11 M allocations: 643.639 MiB, 0.48% gc time, 1.11% compilation time)

```

I’m testing Plots.jl since you complained, and to your numbers, but the better package by now seems to be Makie.jl, and there are other simpler with very fast startup.

You can actually get instantaneous startup, I understand, of (these/these?) [plotting] packages, by putting in your sysimage, still showing for 1.7.0 without that:

```julia
julia> @time using CairoMakie
  8.230858 seconds (12.80 M allocations: 891.117 MiB, 6.84% gc time, 11.23% compilation time)

julia> @time using AlgebraOfGraphics
  8.557753 seconds (13.31 M allocations: 922.143 MiB, 6.76% gc time, 12.52% compilation time)

```

[the times do not add up for both of above, you only get extra 0.3 sec for the latter after `using`ing the former, and I believe you can use them together.]

or if you need 3D/OpenGL other backends:

```julia
julia> @time using GLMakie
 10.075012 seconds (14.93 M allocations: 1021.257 MiB, 8.08% gc time, 9.91% compilation time)

julia> @time using RPRMakie
  8.130355 seconds (12.83 M allocations: 892.046 MiB, 6.78% gc time, 10.59% compilation time)

```

`*` DifferentialEquations.jl also has 70% faster startup (on 1.7.0) at 10 sec. Maybe not great, but likely the slowest package in the Julia ecosystem to start (but fastest at runtime compares to any other language). Since you compare to Python, and it or no language compares for this, not too helpful to look at the slow (by now tolerable?) startup time. Also use can use it from Python, but since you’re then calling Julia, I assume the startup is the same.

With 1.9 not out, it’s of course not yet supported on 1.9, and it might be also much faster after that upgrade, as Plots.jl did, when this fixed:

```julia
julia> @time using DifferentialEquations
[Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
ERROR: LoadError: Sundials is not properly installed. Please run Pkg.build("Sundials")

```

> [@Volker\_Weissmann](#):
>
> The “using …” command is extremely slow:
> 
> > julia\> @time using Plots  
> > 12.731850 seconds (17.25 M allocations: 976.326 MiB, 3.64% gc time)
> > 
> > julia\> @time using DifferentialEquations  
> > 34.780873 seconds (41.90 M allocations: 2.456 GiB, 2.63% gc time)
> > 
> > julia\> @time using Atom  
> > 3.137487 seconds (2.95 M allocations: 184.199 MiB, 1.27% gc time)

[I get actually slightly slower timing for Atom, but it could be my machine, and since Atom is in maintenance mode, VS Code is what’s important now (and is fast for me).]

I realized there’s one minor regression on master where I do not get this (convenient) prompt, unlike on 1.7.0 [EDIT: Issue filed, see next comment]

---

_[View the full topic](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659)._
