Skip to content

Commit b5ca9aa

Browse files
authored
add basic precompilation (#337)
1 parent f93688a commit b5ca9aa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/JSON.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ using .Serializations: Serialization, CommonSerialization,
2828
# for pretty-printed (non-compact) output, JSONText must be re-parsed:
2929
Writer.lower(json::JSONText) = parse(json.s)
3030

31+
function _precompile_()
32+
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
33+
x = "{\"type\":\"callback\",\"data\":{\"callback\":1,\"result\":true,\"error\":false}}"
34+
JSON.lower(JSON.parse(x))
35+
end
36+
37+
_precompile_()
38+
3139
end # module

0 commit comments

Comments
 (0)