From 4ce7d10ca6ea6b56e5dc6decfa90ccb08a04bace Mon Sep 17 00:00:00 2001 From: Omar Elrefaei Date: Thu, 15 Jun 2023 14:47:25 -0400 Subject: [PATCH 1/2] Tweak type inference to improve TTFX --- src/types.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types.jl b/src/types.jl index 6dc8eb5..b4ffde4 100644 --- a/src/types.jl +++ b/src/types.jl @@ -15,12 +15,12 @@ struct ManualDataDep <: AbstractDataDep message::String end -struct DataDep{H, R, F, P} <: AbstractDataDep +struct DataDep <: AbstractDataDep name::String - remotepath::R - hash::H - fetch_method::F - post_fetch_method::P + remotepath + hash + fetch_method + post_fetch_method extra_message::String end From a71561c7a336856d6048e0fd4399302366261763 Mon Sep 17 00:00:00 2001 From: Omar Elrefaei Date: Thu, 15 Jun 2023 15:47:47 -0400 Subject: [PATCH 2/2] Add a precompile statement to further improve TTFX --- src/DataDeps.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DataDeps.jl b/src/DataDeps.jl index 59011c6..8ec41fd 100644 --- a/src/DataDeps.jl +++ b/src/DataDeps.jl @@ -29,4 +29,12 @@ include("preupload.jl") include("fetch_helpers.jl") include("post_fetch_helpers.jl") + +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + Base.precompile(Tuple{typeof(resolve), DataDep, String, String}) # time: 0.007738324 +end + +_precompile_() + end # module