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 flox
Recipients eric.smith, ezio.melotti, flox, lemburg, pitrou
Date 2010-01-04.15:25:48
SpamBayes Score 3.17105e-05
Marked as misclassified No
Message-id <1262618752.6.0.0388266575654.issue7622@psf.upfronthosting.co.za>
In-reply-to
Content
And now, the figures.

There's no gain for the string methods.
Some unicode methods are faster: split/rsplit/replace:


Most significant results:

--- bench_slow.log  Trunk
+++ bench_fast.log  Patched

 string unicode
 (ms)   (ms)    comment

 ========== late match, 100 characters
-13.30  20.51   s="ABC"*33; ("E"+s+("D"+s)*500).rsplit("E"+s, 1) (*100)
-16.12  29.88   s="ABC"*33; ((s+"D")*500+s+"E").split(s+"E", 1) (*100)
+13.27  14.38   s="ABC"*33; ("E"+s+("D"+s)*500).rsplit("E"+s, 1) (*100)
+16.19  17.61   s="ABC"*33; ((s+"D")*500+s+"E").split(s+"E", 1) (*100)

 ========== quick replace multiple character match
-4.51   159.78  ("A" + ("Z"*128*1024)).replace("AZZ", "BBZZ", 1) (*100)
+3.67   7.30    ("A" + ("Z"*128*1024)).replace("AZZ", "BBZZ", 1) (*100)

 ========== quick replace single character match
-3.73   50.61   ("A" + ("Z"*128*1024)).replace("A", "BB", 1) (*100)
+3.72   7.18    ("A" + ("Z"*128*1024)).replace("A", "BB", 1) (*100)

(full benchmark diff is attached)

And we save 1000 lines of code cumulated
(stringobject.c/unicodeobject.c/bytearrayobject.c)
History
Date User Action Args
2010-01-04 15:25:52floxsetrecipients: + flox, lemburg, pitrou, eric.smith, ezio.melotti
2010-01-04 15:25:52floxsetmessageid: <1262618752.6.0.0388266575654.issue7622@psf.upfronthosting.co.za>
2010-01-04 15:25:50floxlinkissue7622 messages
2010-01-04 15:25:50floxcreate