Skip to content

Commit

Permalink
add nested getindex to precompile (#271)
Browse files Browse the repository at this point in the history
The top level getindex is `get(obj::JSON3.Object{Vector{UInt8}, Vector{UInt64}}, key)`, but a nested getindex will be using a subarray so it needs different compilation.  `get(obj::JSON3.Object{Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}, key`
  • Loading branch information
oscardssmith authored Sep 21, 2023
1 parent 717406d commit 0480e3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/workload.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using PrecompileTools

@compile_workload begin
str = """{"a": 1, "b": "hello, world", "c": [1, 2], "d": true, "e": null, "f": 1.92}"""
str = """{"a": 1, "b": "hello, world", "c": [1, 2], "d": true, "e": null, "f": 1.92, "g": {"a": {"a" : "b"}}}"""

JSON3.read(IOBuffer(str))
json = JSON3.read(str)
for i in "abcdef"
json[i]
end
json[:g][:a][:a]

JSON3.read(
str,
Expand Down

0 comments on commit 0480e3f

Please sign in to comment.