# Why loading a Package is slow (Julia 1.6)

**URL:** <https://discourse.julialang.org/t/why-loading-a-package-is-slow-julia-1-6/64868>\
**Category:** Performance\
**Tags:** package, startup\
**Created:** [July 18, 2021, 6:33pm UTC](https://discourse.julialang.org/t/why-loading-a-package-is-slow-julia-1-6/64868 "2021-07-18T18:33:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [July 18, 2021, 6:33pm UTC](https://discourse.julialang.org/t/why-loading-a-package-is-slow-julia-1-6/64868/1 "2021-07-18T18:33:58Z")

</div>

I know that there has been a lot of conversation in the past about this, but most of the questions end with a response like “in Julia 1.6 the loading time will be much better”.  
Since we are in Julia 1.6 I would like to again ask the question and if someone could identify the different factors that lead to such a delay when loading packages.

The way I see it, precompilation is already handled and now should NOT be a delay factor when loading a package e.g. with `using`, since it’s already precombiled when updating the package registry.  
Another factor is method invalidations, which were severely decreased in Julia 1.6.  
Another factor is simply loading types and method definitions, which if I am not wrong should be the biggest part ?

Could you please identify other factors that lead to noticeable delay when loading a package ?

e.g. when I load Plots I get almost 5 secs of delay. what’s the reason behind ?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [July 18, 2021, 7:00pm UTC](https://discourse.julialang.org/t/why-loading-a-package-is-slow-julia-1-6/64868/2 "2021-07-18T19:00:53Z")

</div>

Check this explanation:

> [@Julia precompilation limits or are there really any?](https://discourse.julialang.org/t/julia-precompilation-limits-or-are-there-really-any/55224/2):
>
> I’m not an expert on the topic, so others more knowledgeable about the compiler can definitely chime in here. But from my understanding: Currently there will always be some compilation cost on the first call. Precompile directives only save type-inferred code, not native code, so the first time a precompiled method is called the compiler still needs to do some work. However, a major part of compiling time is spent in type inference, so precompilation will still significantly cut package loadin…
