# Julia v1.6: \`using\` is faster but first call is slower

**URL:** <https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838>\
**Category:** Performance\
**Tags:** question\
**Created:** [February 8, 2021, 12:27pm UTC](https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838 "2021-02-08T12:27:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranocha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ranocha/32/35588_2.png) [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Post date:** [February 8, 2021, 12:27pm UTC](https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838/1 "2021-02-08T12:27:33Z")

</div>

Thanks a lot to all contributors to reduce latency in the new release candidate of Julia v1.6 - great work!

I recognized that `using` can be significantly faster in Julia v1.6, but the first function call becomes significantly slower. Summing up both, there is still a gain of ca. 15% in total, but I couldn’t find anything in [NEWS.md](https://github.com/JuliaLang/julia/blob/release-1.6/NEWS.md) indicating why the first function call becomes slower. Is there some trivial optimization opportunity that we missed in [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)?

Here is an example. On Julia v1.5.3, I get

```julia
julia> using Pkg; Pkg.activate(temp=true); Pkg.add("Trixi")

julia> @time using Trixi # running this block the second time, no precompilation included
 12.832311 seconds (39.01 M allocations: 2.121 GiB, 4.85% gc time)

julia> @time trixi_include(default_example())
[...]
 23.761264 seconds (61.87 M allocations: 3.114 GiB, 4.62% gc time)

```

On Julia v1.6.0-rc1, I get

```julia
julia> using Pkg; Pkg.activate(temp=true); Pkg.add("Trixi")

julia> @time using Trixi # running this block the second time, no precompilation included
  3.260989 seconds (9.36 M allocations: 666.299 MiB, 3.18% gc time, 0.09% compilation time)

julia> @time trixi_include(default_example())
[...]
 28.165085 seconds (66.61 M allocations: 3.797 GiB, 4.24% gc time, 0.09% compilation time)

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [February 8, 2021, 12:30pm UTC](https://discourse.julialang.org/t/julia-v1-6-using-is-faster-but-first-call-is-slower/54838/2 "2021-02-08T12:30:22Z")

</div>

> [@ranocha](#):
>
> I couldn’t find anything in [NEWS.md](https://github.com/JuliaLang/julia/blob/release-1.6/NEWS.md) indicating why the first function call becomes slower.

I don’t think this is an intended feature, hence no need to document it. It’s more likely that compilation of that specific function got somehow slower.
