quinnj / JSON3.jl

Other
214 stars 47 forks source link

add nested getindex to precompile #271

Closed oscardssmith closed 1 year ago

oscardssmith commented 1 year ago

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

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.12% :warning:

Comparison is base (717406d) 89.61% compared to head (e11e475) 89.49%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #271 +/- ## ========================================== - Coverage 89.61% 89.49% -0.12% ========================================== Files 10 10 Lines 1820 1819 -1 ========================================== - Hits 1631 1628 -3 - Misses 189 191 +2 ``` | [Files Changed](https://app.codecov.io/gh/quinnj/JSON3.jl/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jacob+Quinn) | Coverage Δ | | |---|---|---| | [src/workload.jl](https://app.codecov.io/gh/quinnj/JSON3.jl/pull/271?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jacob+Quinn#diff-c3JjL3dvcmtsb2FkLmps) | `100.00% <100.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/quinnj/JSON3.jl/pull/271/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jacob+Quinn)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

quinnj commented 1 year ago

Ope, it looks like the Documenter 1.0 release is breaking my docs, so I'll fix that separately. Merging.

oscardssmith commented 1 year ago

hmm. There still seems to be about a 67ms delay for the first getindex. MWE is

using JSON3
str = """{
    "glossary": {
        "title": "example glossary",
        "GlossDiv": {
            "title": "S",
            "GlossList": {
                "GlossEntry": {
                    "ID": "SGML",
                    "SortAs": "SGML",
                    "GlossTerm": "Standard Generalized Markup Language",
                    "Acronym": "SGML",
                    "Abbrev": "ISO 8879:1986",
                    "GlossDef": {
                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
                        "GlossSeeAlso": ["GML", "XML"]
                    },
                    "GlossSee": "markup"
                }
            }
        }
    }
}"""
data = JSON3.read(IOBuffer(str));
data[:glossary][:title]