Skip to content

Commit

Permalink
Precompile some functions to reduce compilation seen by users
Browse files Browse the repository at this point in the history
  • Loading branch information
NHDaly committed Nov 4, 2021
1 parent 355f4f5 commit cc7e84e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/PProf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,12 @@ end

include("flamegraphs.jl")


# Precompile as much as possible, so that profiling doesn't end up measuring our own
# compilation.
function __init__()
precompile(pprof, ()) || error("precompilation of package functions is not supposed to fail")
precompile(kill, ()) || error("precompilation of package functions is not supposed to fail")
precompile(refresh, ()) || error("precompilation of package functions is not supposed to fail")
end
end # module

0 comments on commit cc7e84e

Please sign in to comment.