mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
* Remove the large-array cliff past 2^20 elements Arrays longer than 2^20 kept every element beyond the cutoff in a sorted side store, and each indexed write to an existing entry deleted and reinserted it, so fill + indexed read/write loops went quadratic (n=1.2M: 10.4s on macOS arm64, 12.6s on Linux x64). - Rewrite existing sparse entries in place. - Let dense storage grow past the cutoff for contiguous extension of a populated prefix, bulk range writes, and sparse tails that reach 3/16 density, migrating side-store entries so index < cap stays dense. - Make the side store a deque with front slack so descending first-touch writes and prefix migration are amortized O(1). - Bound range-derived slice/splice capacity hints for hole runs. scr_arr_new now reserves the live count, so a 2^20+3 element Set converts into dense storage instead of a sparse tail; the white-box test_lib check that pinned the old policy now asserts dense storage. * Share immortal boolean union boxes Maybe-undefined reads of boolean[] elements (`if (composite[i])` in a sieve) box the element in a boolean|undefined union and free it at once: one calloc/free pair per read, about a quarter of numeric-kernels samples at large scales. Unions are immutable and boolean arms own no payload, so low tags now return headerless immortal instances, the same convention as the compiler's static unit-arm constants. * Record preflight/order baselines for corpus 3138