3 ms·
Not 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 s
by mattip 8y ago
Not 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.