Streamline typed JSON parsing for trim compilation - #475
Merged
Conversation
Route buffer inputs through the positional parsing core, preserve StructUtils customization, and make escaped keys consistent across equality, hashing, symbols, and diagnostics. Add a bounded precompile workload and permanent typed, untyped, tag, and trim coverage.
JSON requires StructUtils 2.8.3 before that release exists in General. Add the exact StructUtils PR head to test and documentation environments, and document the removal trigger.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #475 +/- ##
=======================================
Coverage 90.48% 90.49%
=======================================
Files 7 7
Lines 1430 1452 +22
=======================================
+ Hits 1294 1314 +20
- Misses 136 138 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Exercise integer and opaque unknown-key rendering through the diagnostic API. This covers the safe fallback branches without weakening Codecov's project threshold.
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.
Summary
FieldSink{T}construction pathPtrStringfield matching while StructUtils keeps a generic source contractPtrStringvalues to user codeignore=truetags under strict unknown-field handlingWhy
This keeps typed parsing statically reachable for trim compilation without the interpreter plus per-struct
:hotsplit proposed in #473. The implementation uses ordinary Julia specialization. Applications that want persisted first-use work can use a normalPrecompileTools.@compile_workload; no JSON-specific struct annotations or registries are required.Performance
The comparison used Julia 1.12.6 and the same Parsers revision for upstream, this branch, #473's default interpreter, and #473 with
:hot.:hotThe small-struct and shuffled-wide regressions are explicit. No measured row is more than 1.25x slower than upstream. JSON writing is effectively unchanged.
For 100 mixed DTOs, first use is 9.78 seconds here versus 16.48 seconds upstream, 10.65 seconds for #473's default interpreter, and 17.19 seconds for
:hot. The cost scales linearly through 100 types.A standard application workload gives:
:hotValidation
dicttype, custom null values, unknown-field errors, andparse!The trim test environment resolves registered Parsers 2.8.7, which includes the inference fix from #207. Full downstream application trim validation remains a pre-merge integration gate.
Co-authored by Codex