eGenix at the EuroPython Conference 2014

wxjmfauth at gmail.com wxjmfauth at gmail.com
Fri Jul 4 11:24:07 CEST 2014


==============

>>> sys.getsizeof('a')
26
>>> sys.getsizeof('EURO')
40
>>> import timeit
>>> timeit.timeit("('abc'*1000 + 'z').find('z')")
2.4989620382882043
>>> timeit.timeit("('abc'*1000 + 'EURO').find('EURO')")
5.09689729988173
>>> 
>>> 
>>> # ditto, for a dozen European languages
>>> # languages using a latin alphabet with
>>> # some small exceptions (eg German (Germany))
>>> 
>>> # Py3.2 does better!
>>>

jmf



More information about the Python-list mailing list