mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
scr_str_case_conv scans ASCII text for the first letter to convert eight bytes at a time, then converts the rest eight bytes at a time; the tail and big-endian targets take the byte loop. With a refreshed profile, the byte-at-a-time scan compiled worse for short strings with nothing to convert, which made validate-errors slower. The runtime profile is collected again on this change with scripts/refresh-runtime-profile.mjs (326 raw profiles). Changed functions hold 0.0% of its counts, against 3.7% for the previous one. tests/corpus/string-case-ascii-words.ts covers ASCII strings of every length from 0 to 40, with letters at block boundaries and next to the bytes just outside A-Z and a-z.