fix(dynamic): nullable-string null + dynamic-string/lazy-slot perf, c…#203
Merged
Conversation
…hart overhaul A null value for a nullable string field on the lazy/dynamic path was decoded as a quoted string: __deserialize tested isString<T>() (true for string|null) before the null-literal check, so `null` aborted under NAIVE and produced garbage under SWAR/SIMD. The null check now precedes the string branch, matching parseInternal. Surfaced as a crash in the classic/citm_catalog.lazy benchmark. perf(dynamic): materialized JSON.Value/Obj/Arr strings cache a 2-bit escape class in spare NaN-box payload bits, so a clean string re-serializes via a single memory.copy instead of a per-char escape scan (~3x; 3.8 -> 11.5 GB/s on 1 MB). Obj/Arr persist the class back into their value slot. Rebalance the lazy value-slot packing 22/22 -> 23/21 (offset/length): ~16 MB compact source range. chore(bench): rename chart scripts chartNN -> descriptive names, emit both SVG and PNG per chart, switch the README fully to SVG with the real-world payload charts up top + an auto-pinned "browse charts" link, add a JSON.Value dynamic series to the string-throughput charts, vertical labels on the classic charts. test: dynamic-string-class + lazy-slot-encoding suites.
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.
…hart overhaul
A null value for a nullable string field on the lazy/dynamic path was decoded as a quoted string: __deserialize tested isString() (true for string|null) before the null-literal check, so
nullaborted under NAIVE and produced garbage under SWAR/SIMD. The null check now precedes the string branch, matching parseInternal. Surfaced as a crash in the classic/citm_catalog.lazy benchmark.perf(dynamic): materialized JSON.Value/Obj/Arr strings cache a 2-bit escape class in spare NaN-box payload bits, so a clean string re-serializes via a single memory.copy instead of a per-char escape scan (~3x; 3.8 -> 11.5 GB/s on 1 MB). Obj/Arr persist the class back into their value slot. Rebalance the lazy value-slot packing 22/22 -> 23/21 (offset/length): ~16 MB compact source range.
chore(bench): rename chart scripts chartNN -> descriptive names, emit both SVG and PNG per chart, switch the README fully to SVG with the real-world payload charts up top + an auto-pinned "browse charts" link, add a JSON.Value dynamic series to the string-throughput charts, vertical labels on the classic charts.
test: dynamic-string-class + lazy-slot-encoding suites.