Where is load-time spent (with skipped precompilation)

Answering myself: I profiled with SnoopCompile:

using SnoopCompile, ProfileView
tinf = @snoopi_deep (using VoltoMapSim)
ProfileView.view(flamegraph(tinf));

Turns out, a lot of this import time is spent in compiling expanded macro calls:

  • @match (Match.jl)
  • @showprogress (ProgressMeter.jl)
  • @with_kw (Parameters.jl)
  • f"Python-style f-string {x:.2f}" (PyFormattedStrings.jl)
  • @set (Setfield.jl)

Plus:

  • ComponentVector(; myname=1, othername=2, …) (ComponentArrays.jl)
  • PyCall.setindex!(::PyDict{…}, …) (PyPlot.jl)
  • a bunch of custom Tuple and NamedTuple constructions

I’ll see if I can get rid of some of those / maybe precompile them in an upstream less-updated package.

2 Likes