On Wed, Oct 12, 2016 at 3:39 PM Nathaniel Smith <njs@pobox.com> wrote:
It looks like PyUnicode_Compare already has a special case to use
memcmp when both of the strings fit into latin1:

Wow! That's great! I didn't even try reading through unicode_compare, because I felt I might miss some subtle detail that would break everything. But ya, that's great! Since surely latin1 is the most common use case. So I'll just add a latin1 check in the check-loop, and then I'll have two unsafe_unicode_compare functions. I felt bad about not being able to get the same kind of string performance I had gotten with python2, so this is nice.