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 belopolsky, eric.araujo, ezio.melotti, jcea, lemburg, sdaoden, vstinner
Date 2011-02-24.16:35:45
SpamBayes Score 0.011992287
Marked as misclassified No
Message-id <1298565346.38.0.475538797853.issue11303@psf.upfronthosting.co.za>
In-reply-to
Content
Ooops, I attached the wrong patch. Here is the new fixed patch.

Without the patch:

>>> import timeit
>>> timeit.Timer("'a'.encode('latin1')").timeit()
3.8540711402893066
>>> timeit.Timer("'a'.encode('latin-1')").timeit()
1.4946870803833008

With the patch:

>>> import timeit
>>> timeit.Timer("'a'.encode('latin1')").timeit()
1.4461820125579834
>>> timeit.Timer("'a'.encode('latin-1')").timeit()
1.463456153869629

>>> timeit.Timer("'a'.encode('UTF-8')").timeit()
0.9479248523712158
>>> timeit.Timer("'a'.encode('UTF8')").timeit()
0.9208409786224365
History
Date User Action Args
2011-02-24 16:35:46vstinnersetrecipients: + vstinner, lemburg, jcea, belopolsky, ezio.melotti, eric.araujo, sdaoden
2011-02-24 16:35:46vstinnersetmessageid: <1298565346.38.0.475538797853.issue11303@psf.upfronthosting.co.za>
2011-02-24 16:35:45vstinnerlinkissue11303 messages
2011-02-24 16:35:45vstinnercreate