[Python-Dev] New stringbench benchmark results (original) (raw)
Victor Stinner victor.stinner at haypocalc.com
Fri Oct 7 21:46:15 CEST 2011
- Previous message: [Python-Dev] New stringbench benchmark results
- Next message: [Python-Dev] check for PyUnicode_READY look backwards
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le jeudi 6 octobre 2011 02:06:30, Victor Stinner a écrit :
The rfind case is really strange: the code between Python 3.2 and 3.3 is exactly the same. Even in Python 3.2: rfind looks twice faster than find:
("AB"*300+"C").find("BC") (*1000) : 1.21 ("C"+"AB"*300).rfind("CA") (*1000) : 0.57
It looks to be a gcc bug: using attached patch (written by Antoine), str.find() is a little bit faster. With the patch, the function does the same memory access, but it generates a different machine code.
I don't know exactly the difference yet, but it may be related to the CMOVNE instruction (which looks to be slower than a classical conditional jump, JNE).
Victor -------------- next part -------------- A non-text attachment was scrubbed... Name: fastsearch_gcc_bug.patch Type: text/x-patch Size: 1431 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20111007/88c504c5/attachment.bin>
- Previous message: [Python-Dev] New stringbench benchmark results
- Next message: [Python-Dev] check for PyUnicode_READY look backwards
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]