STINNER Victor <victor.stin...@haypocalc.com> added the comment:

Grouped results.

find (first):

- (b"A"*1000).find(b"A")    : -70%
- (b"A"*1000).rfind(b"A")   : -70%
- (b"A"*1000).index(b"A")   : -71%
- (b"A"*1000).rindex(b"A")  : -68%

- (b"AB"*1000).index(b"AB") : -68%
- (b"AB"*1000).rindex(b"AB"): -67%
- (b"AB"*1000).find(b"AB")  : -69%
- (b"AB"*1000).rfind(b"AB") : -69%

- b"Andrew".startswith(b"Andrew"): -20%
- b"Andrew".startswith(b"A")     : -21%
- b"Andrew".startswith(b"Anders"): -21%

- b"Andrew".endswith(b"w"): -21%

find (last):

- (b"AB"*300+"CA").find(b"CA")  : -33%
- (b"C"+"AB"*300).rindex(b"CA") : -29%
- (b"AB"*300+"C").find(b"BC")   : -28%
- (b"AB"*300+"C").index(b"BC")  : -28%
- (b"C"+b"AB"*300).rfind(b"CA") : -29%
- (b"BC"+b"AB"*300).rfind(b"BC"): -42%
- s=b"ABC"*33; (s+b"E"+(b"D"+s)*500).rfind(s+b"E"): -28%

find (not found):

- (b"A"*1000).find(b"B")    : -48%
- (b"A"*1000).rfind(b"B")   : -37%
- (b"AB"*1000).rfind(b"CA") : -20%
- (b"AB"*1000).rfind(b"BC") : -35%

others:

- b"B" in b"A"*1000           : -24%
- (b"A"*1000).partition(b"B") : -30%

----------
nosy: +haypo

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

Reply via email to