Performance of int/long in Python 3

jmfauth wxjmfauth at gmail.com
Mon Apr 1 15:15:25 EDT 2013


---------


I'm not whining or and I'm not complaining (and never did).
I always exposed facts.

I'm not especially interested in Python, I'm interested in
Unicode.

Usualy when I posted examples, there are confirmed.


What I see is this (std "download-abled" Python's on Windows 7 (and
other
Windows/platforms/machines):

Py32
>>> import timeit
>>> timeit.repeat("'a' * 1000 + 'ẞ'")
[0.7005365263669056, 0.6810694766790423, 0.6811978680727229]
>>> timeit.repeat("'a' * 1000 + 'z'")
[0.7105829560031083, 0.6904999426964764, 0.6938637184431968]

Py33
import timeit
timeit.repeat("'a' * 1000 + 'ẞ'")
[1.1484035160337613, 1.1233738895227505, 1.1215708962703874]
timeit.repeat("'a' * 1000 + 'z'")
[0.6640958193635527, 0.6469043692851528, 0.6458961423900007]

I have systematically such a behaviour, in 99.99999% of my tests.
When there is something better, it is usually because something else
(3.2/3.3) has been modified.

I have my idea where this is coming from.

Question: When it is claimed, that this has been tested,
do you mean stringbench.py as proposed many times by Terry?
(Thanks for an answer).

jmf




More information about the Python-list mailing list