Why loading a Package is slow (Julia 1.6)

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 ?

Check this explanation:

3 Likes