Repository navigation
Faster coordinate reads and writes on JSON.jl v1 (0.8.6) - #132
Open
asinghvi17 wants to merge 5 commits into
Open
asinghvi17 wants to merge 5 commits into
asinghvi17 wants to merge 5 commits into
Conversation
asinghvi17
force-pushed
the
as/json1-perf
branch
from
October 25, 2026 17:31
a7eb609 to
7089982
Compare
asinghvi17
marked this pull request as ready for review
October 25, 2026 17:31
Keep the public reader as a guarded fallback and preserve JSON writer options through a dedicated GeoJSON write style. Support Parsers 2.8.8 and 3 without changing A’s bytes, numeric rounding, retry behavior or error types. Harness: codex Model: gpt-6.1-sol
…tion Preserve the existing schema and hash order while collecting distinct types in one pass. Add reproducible coordinate benchmarks, fresh-process input checks and downstream smoke checks. Harness: codex Model: gpt-6.1-sol
Use concrete observed types and direct tuple slots for common arities. Share JSON’s existing String parser across input wrappers, copying mutable byte storage without consuming it. Keep small Point writes generic; use growing String-backed Ryu buffers and a guarded outer size hint to avoid repeated growth. Exercise general arities, input ownership and diagnostics, and both writer fallbacks. Harness: codex Model: gpt-6.1-sol
Keep lasting read, input ownership, feature id, lazy collection, type and writer checks in topical testsets. Remove historical byte/schema fixtures and migration-only serialization checks. Harness: codex Model: gpt-6.1-sol
Exercise non-generated scanners through typed JSON reads, roundtrips and invalid dimensions. Cover float and big IDs plus optional CRS in nonfinite collections without changing coverage thresholds. Harness: codex Model: gpt-6.1-sol
asinghvi17
force-pushed
the
as/json1-perf
branch
from
October 25, 2026 23:56
c0292d9 to
c28a199
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #131; review that one first. After the move to JSON.jl v1, coordinates were read one generic scalar at a time with an allocation per position, and the eager Tables schema rebuilt a
Unionfor every feature and column, so coordinate-heavy files were about twice as slow as with JSON3.This scans Float32 and Float64 coordinates directly from the input bytes, writes coordinate text with
Base.Ryuinto a single buffer, and builds each column's type union once. JSON.jl internals are used only behind feature checks, with the public path as a tested fallback, and Parsers stays compatible with both 2.8.8 and 3. Output bytes and error types are unchanged.On Julia 1.13 the minimum time to read a large polygon file falls from 103.7 ms to 45.3 ms and to write it from 111.1 ms to 56.6 ms, below JSON3's times, and read allocations drop from about 600,000 to 224. Writes allocate somewhat more temporary memory (49.5 MB instead of 32.2 MB).
benchmark/run.jlreproduces the numbers, and CI now tests the dependency floors with both Parsers 2.8.8 and 3.0.0. Bumps the version to 0.8.6.🤖 Generated with Claude Code