Skip to content

Commit

Permalink
add basic precompilation (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz authored Feb 8, 2022
1 parent f93688a commit b5ca9aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/JSON.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b5ca9aa

Please sign in to comment.