-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise MemoryParserState #235
Comments
As far as the fallback on slow parsing, I think instead, the approach of calculating the correct length first (which can be very fast, simply scan for |
See #236, which addresses several of these points, although further optimization is of course possible. |
FYI, I've been experimenting with a lazy JSON parser: https://github.com/samoconnor/jsonhack [Update: a simpler and lazyer variation test/benchmark.jl uses a 1MB AWS API definition JSON file to compare performance vs JSON.jl. When accessing a value close to the start of the file the lazy parser is ~2000 times faster than JSON.jl, for 2 values near then end of the file, the lazyer parser is ~6 times faster and allocates 0.07MiB vs 913 MiB.
test/runtests.jl uses https://github.com/nst/JSONTestSuite to check parser corner case behaviour. |
I wasn't aware of the test suite, that's great. I found some bugs (which I've fixed in my parsing rewrite PR that I'm reading in), I'm sure that test suite would have caught them. |
cc @ScottPJones, @stevengj
MemoryParserState needs a big revision as it has aged over the years. I merged #234 in the meantime as the performance has not been benchmarked in a while and it is probably not worth the extra effort to continue to maintain the current code. I expect to have some time this week to take on this project, and so far have the following ideas in mind, alongside the Julia v0.6 and v0.7 modernization:
Vector{UInt8}
,String
can be used directly in many situations.The text was updated successfully, but these errors were encountered: