¡@

Home 

python Programming Glossary: usec

Python List Comprehension Vs. Map

http://stackoverflow.com/questions/1247486/python-list-comprehension-vs-map

s'xs range 10 ' 'map hex xs ' 100000 loops best of 3 4.86 usec per loop python mtimeit s'xs range 10 ' ' hex x for x in xs.. 10 ' ' hex x for x in xs ' 100000 loops best of 3 5.58 usec per loop An example of how performance comparison gets completely.. 10 ' 'map lambda x x 2 xs ' 100000 loops best of 3 4.24 usec per loop python mtimeit s'xs range 10 ' ' x 2 for x in xs '..

Python string 'join' is faster(?) than '+', but what's wrong here?

http://stackoverflow.com/questions/1349311/python-string-join-is-faster-than-but-whats-wrong-here

in xrange 100 1000 ' 's .join r ' 1000 loops best of 3 319 usec per loop 900 strings of 300 chars each joining the list directly.. 100 1000 ' 's ' 'for x in r s x' 1000 loops best of 3 779 usec per loop python mtimeit s'r str x 99 for x in xrange 100 1000.. x in r z.append x ' ' .join z ' 1000 loops best of 3 538 usec per loop ...with a semi important amount of data a very few..

Why program functionally in Python?

http://stackoverflow.com/questions/1892324/why-program-functionally-in-python

' 'reduce lambda x y x y L 1 ' 100000 loops best of 3 18.3 usec per loop python mtimeit s'L range 12 52 ' 'p 1' 'for x in L.. 12 52 ' 'p 1' 'for x in L p x' 100000 loops best of 3 10.5 usec per loop so the simple elementary trivial loop is about twice.. ' 'reduce operator.mul L 1 ' 100000 loops best of 3 10.7 usec per loop ...we can get almost back to the easily obtained performance..

Python: removing duplicates from a list of lists

http://stackoverflow.com/questions/2213923/python-removing-duplicates-from-a-list-of-lists

nodup' 'nodup.doset nodup.k ' 100000 loops best of 3 11.7 usec per loop python mtimeit s'import nodup' 'nodup.dosort nodup.k.. nodup' 'nodup.dosort nodup.k ' 100000 loops best of 3 9.68 usec per loop python mtimeit s'import nodup' 'nodup.dogroupby nodup.k.. 'nodup.dogroupby nodup.k ' 100000 loops best of 3 8.74 usec per loop python mtimeit s'import nodup' 'nodup.donewk nodup.k..

How is Python's List Implemented?

http://stackoverflow.com/questions/3917574/how-is-pythons-list-implemented

setup x None 1000 x 500 10000000 loops best of 3 0.0579 usec per loop ... python m timeit setup x None 1000 x 0 10000000.. setup x None 1000 x 0 10000000 loops best of 3 0.0566 usec per loop I would be astounded if IronPython or Jython used linked..

Making a flat list out of list of lists in Python [duplicate]

http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python

in l for item in sublist ' 10000 loops best of 3 143 usec per loop python mtimeit s'l 1 2 3 4 5 6 7 8 9 99' 'sum l ' 1000.. 1 2 3 4 5 6 7 8 9 99' 'sum l ' 1000 loops best of 3 969 usec per loop python mtimeit s'l 1 2 3 4 5 6 7 8 9 99' 'reduce lambda..