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, ezio.melotti, flox, loewis, pitrou, python-dev, vstinner
Date 2011-12-18.01:47:10
SpamBayes Score 6.977871e-05
Marked as misclassified No
Message-id <1324172831.97.0.124500626891.issue13621@psf.upfronthosting.co.za>
In-reply-to
Content
> I also noticed a difference between Python 3.2 and 3.3,
> but Python 3.3 is 13% *faster* (and not slower).

Oops, I misused the timeit module, there is a regression.

> New changeset c802bfc8acfc by Victor Stinner in branch 'default':
> Issue #13621: Optimize str.replace(char1, char2)

./python -m timeit -s 'f=open("/tmp/README"); t=f.read(); f.close(); t.encode("ascii")' 't.replace("\n", " ")'

Python 3.2: 6.44 usec
Python 3.3 before: 11.6 usec
Python 3.3 after: 2.77 usec
History
Date User Action Args
2011-12-18 01:47:12vstinnersetrecipients: + vstinner, loewis, collinwinter, pitrou, ezio.melotti, flox, Boris.FELD, python-dev
2011-12-18 01:47:11vstinnersetmessageid: <1324172831.97.0.124500626891.issue13621@psf.upfronthosting.co.za>
2011-12-18 01:47:11vstinnerlinkissue13621 messages
2011-12-18 01:47:10vstinnercreate