Python 3 is killing Python

wxjmfauth at gmail.com wxjmfauth at gmail.com
Wed Jul 16 15:10:33 CEST 2014


Le mercredi 16 juillet 2014 14:10:16 UTC+2, Steven D'Aprano a écrit :

> ...


You are right iso-8859-1 is a plague.

py340

>>> timeit.repeat("'abc'.find('z')")
[0.3915996913892741, 0.3671049942086313, 0.3669506100733315]
>>> timeit.repeat("'abc'.find('oe')")
[0.5678031885837811, 0.5447948325424363, 0.5424782828388004]


note py325
>>> timeit.repeat("'abc'.find('z')")
[0.34638522543825445, 0.32732154158861704, 0.3253417225882629]
>>> timeit.repeat("'abc'.find('oe')")
[0.3162405415102256, 0.3027008165424263, 0.30290324880145647]


py340

>>> sys.getsizeof('z'*123 + 'z')
149
>>> sys.getsizeof('z'*123 + 'oe')
286

py325

>>> sys.getsizeof('z'*123 + 'z')
278
>>> sys.getsizeof('z'*123 + 'oe')
278

Brillant no?


jmf



More information about the Python-list mailing list