This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Boris.FELD, collinwinter, vstinner
Date 2011-12-17.18:07:10
SpamBayes Score 0.07610229
Marked as misclassified No
Message-id <1324145231.49.0.599063292197.issue13622@psf.upfronthosting.co.za>
In-reply-to
Content
Sorted and grouped results. "replace", "find" and "concat" should be easy to fix, "strip" and "split" depend on "find" performance.


replace:

- b"...text.with.2000.lines...replace(b"\n", b" ") (*10): -37.668161%

find:

- (b"A"*1000).find(b"B") (*1000): -30.379747%

- b"Andrew".startswith(b"A") (*1000): -20.588235%
- b"Andrew".startswith(b"Anders") (*1000): -23.529412%

- b"Andrew".endswith(b"w") (*1000): -23.529412%
- b"Andrew".endswith(b"Andrew") (*1000): -22.857143%
- b"Andrew".endswith(b"Anders") (*1000): -23.529412%

- b"B" in b"A"*1000 (*1000): -32.089552%

concat:

- b"Andrew"+b"Dalke" (*1000): -23.076923%

strip:

- b"\nHello!\n".strip() (*1000): -33.333333%
- b"Hello!\n".strip() (*1000): -35.714286%
- b"\nHello!".strip() (*1000): -28.571429%

- b"Hello\t   \t".rstrip() (*1000): -33.333333%
- b"\t   \tHello".rstrip() (*1000): -33.333333%
- b"Hello!\n".rstrip() (*1000): -35.714286%
- b"\nHello!".rstrip() (*1000): -35.714286%

split:

- dna.split(b"ACTAT") (*10): -21.066667%
- (b"Here are some words. "*2).split() (*1000): -22.105263%
- b"this\nis\na\ntest\n".split(b"\n") (*1000): -23.437500%
- b"this--is--a--test--of--the--emergency--broadcast--system".split(b"--") (*1000): -22.429907%

- b"this\nis\na\ntest\n".rsplit(b"\n") (*1000): -23.437500%

- (b"A"*1000).rpartition(b"A") (*1000): -21.212121%
History
Date User Action Args
2011-12-17 18:07:11vstinnersetrecipients: + vstinner, collinwinter, Boris.FELD
2011-12-17 18:07:11vstinnersetmessageid: <1324145231.49.0.599063292197.issue13622@psf.upfronthosting.co.za>
2011-12-17 18:07:10vstinnerlinkissue13622 messages
2011-12-17 18:07:10vstinnercreate