Richard Saunders, 21.10.2011 20:23:
As long as the two strings are the same unicode "kind", you can use a memcmp to compare. In that case, I would almost argue some memcmp optimization is even more important: unicode strings are potentially 2 to 4 times larger, so the amount of time spent in memcmp may be more (i.e., I am still rooting for -fno-builtin-memcmp on the compile lines).
I would argue that the pure ASCII (1 byte per character) case is even more important than the other cases, and it suffers from the "1 byte per comparison" problem you noted. That's why you got the 2x speed-up for your quick test.
Stefan _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com