tfiers / PkgGraph.jl

Visualize the dependency graph of a Julia package
https://tfiers.github.io/PkgGraph.jl
MIT License
42 stars 2 forks source link

Add precompilation #97

Open tfiers opened 1 year ago

tfiers commented 1 year ago

this deprecates (hopefully)

tfiers commented 1 year ago

Let's time. Now (WSL2):

julia> @re
julia> using PkgGraph
julia> @time PkgGraph.depgraph_as_dotstr(:OrdinaryDiffEq);
  5.050874 seconds (18.93 M allocations: 1.692 GiB, 9.92% gc time, 16.54% compilation time)
tfiers commented 1 year ago

https://timholy.github.io/SnoopCompile.jl/stable/snoop_pc/

hah, so it wasn't a precomp issue: image

tfiers commented 1 year ago

Ok but still useful. This is before any precomp: image

and this is after adding

@precompile_all_calls begin
    depgraph_as_dotstr(:DefaultApplication)
end

image

(julia 1.9, so presumably w/ native code caching)

sure, ok.

tfiers commented 1 year ago

Kindof annoying though: re-precompilation time (i.e. every time I edit the src) is now 4.3 seconds longer (almost 2x as long) whereas TTFX at 0.3 is very reasonable. So I'mma disable it again.

tfiers commented 1 year ago

Ok there is a decent first run delay: https://asciinema.org/a/555338

(asciinema rec, converted to svg with https://github.com/marionebl/svg-term-cli) i.e. svg-term --cast=555338 --out blah.svg (then explorer.exe .))

blah

tfiers commented 1 year ago

re

so precompile the ProgressMeter, and the initial @info of depgraph, yes please; but: I don't want to spew output during precompilation (and @precompile_all_calls does not suppress stdout by default)

tfiers commented 1 year ago

We can profile our compilation (and/or type inference) time:

(snoopi deep)