From b5ca9aa9d360f84326e7de7e3b333e65a399f78e Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Tue, 8 Feb 2022 15:15:54 +0100 Subject: [PATCH] add basic precompilation (#337) --- src/JSON.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/JSON.jl b/src/JSON.jl index 66fb855..b3396f0 100644 --- a/src/JSON.jl +++ b/src/JSON.jl @@ -28,4 +28,12 @@ using .Serializations: Serialization, CommonSerialization, # for pretty-printed (non-compact) output, JSONText must be re-parsed: Writer.lower(json::JSONText) = parse(json.s) +function _precompile_() + ccall(:jl_generating_output, Cint, ()) == 1 || return nothing + x = "{\"type\":\"callback\",\"data\":{\"callback\":1,\"result\":true,\"error\":false}}" + JSON.lower(JSON.parse(x)) +end + +_precompile_() + end # module