|
|
|
|
|
by kstrauser
4667 days ago
|
|
How would a method 7 using generator expressions fare on the same system, like: return ''.join(`num` for num in xrange(loop_count))
On one hand, it avoids creating a temporary list in memory. On the other, it can't know in advance how long the final output of the loop will be and so couldn't use tricks like preallocating enough RAM. |
|
http://docs.python.org/2/library/timeit.html
Results: