mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
Buffer.write(text, "utf16le") zero-extended an ASCII run eight bytes per step with shifts and masks in 64-bit words. Where the target has vector unpacks (SSE2 on x86-64, NEON on AArch64) it now widens sixteen bytes per step: one load, a test of the high bits, and two unpacked stores. The word loop stays for the remaining bytes and for other targets. A scanner that fills a Uint16Array of code units this way, as tsc-ts does once per source file, spends about half as long in the copy.