Skip to content

fix(dynamic): nullable-string null + dynamic-string/lazy-slot perf, c…#203

Merged
JairusSW merged 1 commit into
mainfrom
jairus/v1.5.0-prep
Jun 11, 2026
Merged

fix(dynamic): nullable-string null + dynamic-string/lazy-slot perf, c…#203
JairusSW merged 1 commit into
mainfrom
jairus/v1.5.0-prep

Conversation

@JairusSW

Copy link
Copy Markdown
Owner

…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 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.

…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.
@JairusSW JairusSW merged commit 31120a4 into main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant