Skip to content

Commit cc7e84e

Browse files
committed
Precompile some functions to reduce compilation seen by users
1 parent 355f4f5 commit cc7e84e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/PProf.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,12 @@ end
352352

353353
include("flamegraphs.jl")
354354

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

0 commit comments

Comments
 (0)