On Wed, Jun 25, 2014 at 09:47:07PM -0700, Alex Kleider wrote:

> Thanks for elucidating this.  I didn't know that "several thousand" 
> would still be considered a small number.

On a server, desktop, laptop or notepad, several thousand is not many. 
My computer can generate a dict with a million items in less than a 
second and a half:

py> with Stopwatch():
...     d = {n: (3*n+2)**4 for n in range(1000000)}
...
time taken: 1.331450 seconds


and then process it in under half a second:

py> with Stopwatch():
...     x = sum(d[n] for n in range(1000000))
...
time taken: 0.429471 seconds
py> x
16200013499990999994000001300000

For an embedded device, with perhaps 16 megabytes of RAM, thousands of 
items is a lot. But for a machine with gigabytes of RAM, it's tiny.


-- 
Steven
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to