Files
scriptc/packages/runtime
Malte UblandClaude Opus 5.5 481f9a5e31 Stringify live typed records and arrays without a key list
JSON.stringify of a value reached through `unknown` walks native records
and arrays through their live capsules. The protocol walk built a
key-string array for every record and formatted every array index with
snprintf into a fresh string, only to look the member up again by that
key. A JSON API response of a few records spent most of its
serialization time there.

Without a replacer, walk a live record by field index over a snapshot of
its present fields (its keys are the immortal field names) and a live
array by element index, forming an index string only for a toJSON call
that receives it. Members are still read as scr_json_member reads them,
so callbacks that mutate or materialize the container see the same
results. Index keys elsewhere use the integer formatter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:43:54 -07:00
..
2026-07-22 18:08:04 -05:00
2026-10-22 11:14:27 -05:00