Fixing Ill-Formed UTF-16 Strings With SIMD, 9x faster

lemire · x · 2026-08-26

Daniel Lemire published a new paper on fixing ill-formed UTF-16 strings using SIMD instructions (ARM NEON and x64 SSE/AVX2/AVX-512). It achieves 18.9 GB/s on Apple M4 and 7.5 GB/s on Intel Ice Lake, using as little as 0.4 instructions per byte, up to nine times faster than the old method. The code is in Chromium browsers, and String.prototype.toWellFormed in Node.js 25 is about five times faster.

Related event: SIMD Repairs Malformed UTF-16 Strings 9x Faster(2 posts)→

Original post →

More from Infra

Infra channel →