2 ms·
Is there a write-up of the details of the PyPy UTF-8 Unicode string internals?
by hsivonen 8y ago
Is there a write-up of the details of the PyPy UTF-8 Unicode string internals?
- mattip 8y agoNot really. The UnicodeObject has utf8 bytes, a length in codepoints, and an optional index map that is only calculated if needed to traverse the string. Most strings won’t need the map. String matching is utf8 aware, and indexes by codepoints. The main speedup is in converting unicode to internal representation once, then passing around the object with no further conversions. Not sure that answered the question though.