← All issues

[JSC] Compare 8-bit strings a word at a time in DFG/FTL string equality

2fc620c

JSC's DFG and FTL inline 8-bit string equality directly in JIT-compiled code. This commit replaces the byte-at-a-time loop with a word-at-a-time loop walking backwards, with strings shorter than one pointer-sized word still using the byte loop. The 1–7 byte remainder is handled by a single overlapping word load at offset 0 — safe because the word loop is only entered when length ≥ 8.

Up to 5.85x speedup on 256-byte string equality and 2.86x on longer strings — string keying, deduplication, and property-lookup workloads benefit directly.

🔒

The overlapping-tail load and loop entry guard have edge cases worth investigating — audit directions included.

Subscribe to read more