Florent Xicluna <la...@yahoo.fr> added the comment:

Updated benchmarks.

 str    unicode
 (ms)   (ms)

 ========== late match, 100 characters
                s="ABC"*33; ("E"+s+("D"+s)*500).rfind("E"+s)
 32.89  15.65   rfind (classic)
 32.81  15.63   rindex (classic)
 11.77  13.27   rfind (fastsearch)
 11.78  13.40   rindex (fastsearch)

 ========== late match, two characters
 4.34   2.36    ("C"+"AB"*300).rfind("CA") (classic)
 4.44   2.36    ("C"+"AB"*300).rindex("CA") (classic)
 2.10   2.31    ("C"+"AB"*300).rfind("CA") (fastsearch)
 2.10   2.32    ("C"+"AB"*300).rindex("CA") (fastsearch)

 ========== no match, two characters
 14.12  13.46   ("AB"*1000).rfind("BC") (classic)
 7.67   8.26    ("AB"*1000).rfind("BC") (fastsearch)

----------
stage:  -> patch review
Added file: http://bugs.python.org/file15638/bench_rfind_algorithms_v2.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7462>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to