|
|
|
|
|
by orlandu63
5484 days ago
|
|
I'm getting entirely different results with Python 3.2: % python -m timeit "[ x**3 for x in range(10000) ]"
100 loops, best of 3: 7.85 msec per loop
% python -m timeit "map(lambda x: x**3, range(10000))"
1000000 loops, best of 3: 1.26 usec per loop
By these benchmarks map is 700 times faster than the corresponding list comprehension. |
|