Re:Rust Performance Pitfalls
by kccqzy on Thursday June 08, 2017 @06:29PM
(#14517662)
This has been repeated so many times but UTF-16 does not allow constant time indexing either. Combining characters are one case and they are not rare at all. What about surrogates? What about grapheme clusters that are a complicated sequence of emoji and emoji modifiers with ZWJ?
A better suggestion is to rethink why you need those operations in the first place.
A better suggestion is to rethink why you need those operations in the first place.