12 ms·
UTF-8 -> UTF-16 conversion was at one point a noticeable fraction of Firefox's startup time. https://bugzilla.mozilla.org/show_bug.cgi?id=506431 https://bugzil
by khuey 15y ago
UTF-8 -> UTF-16 conversion was at one point a noticeable fraction of Firefox's startup time.
https://bugzilla.mozilla.org/show_bug.cgi?id=506431 https://bugzilla.mozilla.org/show_bug.cgi?id=506431
Since then we've done things such as fast-path ASCII -> UTF-16 conversion with SSE2 instructions. Converting a few dozen bytes is unlikely to make a significant difference, but often one needs to deal with more than a few dozen bytes.
- ybungalobill 15y agoI believe the authors wrote it clear enough that they don't rule out UTF-16 completely: > We believe that all other encodings of Unicode (or text, in general) belong to rare edge-cases of optimization and should be avoided by mainstream users. So if you're writing a browser that must use UTF-16 in its Javascript engine due to dumb standards... it is a reasonable performance optimizations to use UTF-16 for your strings. But how many people write Javascript engines?