Fixing Ill‐Formed UTF ‐16 Strings With SIMD Instructions
Software: Practice and Experience · 2026-12 · 56 (12) · 1498-1509
DOI: 10.1002/spe.70105 ↗Kurz gefasst
Fachartikel in der Zeitschrift Software: Practice and Experience, online erschienen am 25.08.2026. Verfasst von Robert Clausecker und 1 weiteren Autor:innen. Die Arbeit nennt 19 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: Natural Sciences and Engineering Research Council of Canada.
Abstract (Originalsprache)
Background
We must fix ill‐formed UTF‐16 strings, where surrogate pairs are mismatched. Programming languages such as JavaScript provide functions that replace mismatched surrogates with the Unicode replacement character (U + FFFD).
Objectives
We seek to accelerate the correction of ill‐formed UTF‐16 strings.
Methods
We propose using Single Instruction, Multiple Data (SIMD) instructions to handle multiple code units in parallel, enabling faster and more efficient execution. We provide implementations for ARM NEON and x64 (SSE, AVX2, AVX‐512).
Results
Our implementations reach 18.9 GB/s on an Apple M4 processor and 7.5 GB/s on an Intel Ice Lake processor—up to nine times faster than the scalar baseline of the V8 JavaScript engine—while requiring as little as 0.4 instructions per byte. Integrated into Node.js, our functions make the toWellFormed JavaScript function about five times faster.
Conclusions
Our algorithm achieves significant performance improvements over conventional methods. Our software is part of the Google JavaScript engine (V8) and thus part of several major Web browsers.
Förderung
- Natural Sciences and Engineering Research Council of Canada
Zitieren
APA
Clausecker, R., & Lemire, D. (2026). Fixing Ill‐Formed UTF ‐16 Strings With SIMD Instructions. Software: Practice and Experience, 56(12), 1498-1509. https://doi.org/10.1002/spe.70105
Vancouver
Clausecker R, Lemire D. Fixing Ill‐Formed UTF ‐16 Strings With SIMD Instructions. Software: Practice and Experience. 2026;56(12):1498-1509. doi:10.1002/spe.70105
BibTeX
@article{Clausecker2026,
author = {Clausecker, Robert and Lemire, Daniel},
title = {Fixing Ill‐Formed UTF ‐16 Strings With SIMD Instructions},
journal = {Software: Practice and Experience},
year = {2026},
volume = {56},
number = {12},
pages = {1498--1509},
doi = {10.1002/spe.70105}
}
EUVIMED