2 ms·
Did a quick benchmark: https://gist.github.com/matklad/ebc1acd2fab884f3ff9d96d4175f269b https://gist.github.com/matklad/ebc1acd2fab884f3ff9d96d4175f.... Seems
by matklad 6y ago
Did a quick benchmark: https://gist.github.com/matklad/ebc1acd2fab884f3ff9d96d4175f269b https://gist.github.com/matklad/ebc1acd2fab884f3ff9d96d4175f....
Seems like hypothesis is not wrong, but also is not interesting: the difference is pretty small, and it can be easily dwarfed by the big wins for utf32 if something like auto-vectorization or bounds-check elision kicks in. Also I am not entirely sure that the diff I observe is not due to something completely irrelevant, like one loop ending up on a lucky cacheline or what not.