From 765441c15fbcaa81457f5dac452675edea4bf585 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 8 Feb 2020 09:35:49 -0500 Subject: [PATCH] Add precompiles to reduce startup latency --- src/ClearStacktrace.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ClearStacktrace.jl b/src/ClearStacktrace.jl index 750796f..e9308e2 100644 --- a/src/ClearStacktrace.jl +++ b/src/ClearStacktrace.jl @@ -196,5 +196,10 @@ function Base.show_backtrace(io::IO, t::Vector) printtrace(io, frames) end +# Precompile some methods, to avoid latency at the first call + +precompile(Base.show_backtrace, (Vector{Base.StackTraces.StackFrame},)) +precompile(printtrace, (IO, Vector{Any})) + end # module