Antoine Pitrou, 20.10.2011 23:08: >> I have been doing some performance experiments with memcmp, and I was >> surprised that memcmp wasn't faster than it was in Python. I did a whole, >> long analysis and came up with some very simple results. > > Thanks for the analysis. Non-bugfix work now happens on Python 3, where > the str type is Python 2's unicode type. Your recommendations would > have to be revisited under that light. Well, Py3 is quite a bit different now that PEP393 is in. It appears to use memcmp() or strcmp() a lot less than before, but I think unicode_compare() should actually receive an optimisation to use a fast memcmp() if both string kinds are equal, at least when their character unit size is less than 4 (i.e. especially for ASCII strings). Funny enough, tailmatch() has such an optimisation. Stefan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4