iterators and views of lists

Lie Ryan lie.1296 at gmail.com
Fri Dec 18 14:20:41 EST 2009


On 12/18/2009 7:07 AM, Brendan Miller wrote:
> As for copying pointers not taking much time... that depends on how
> long the list is. if you are working with small sets of data, you can
> do almost anything and it will be efficient. However, if you have
> megabytes or gigabytes of data (say you are working with images or
> video), than the difference between an O(1) or an O(n) operation is a
> big deal.

A 1-million member list takes ~130 msec, 10 million 1.3s. In many cases 
the algorithm would easily dwarf the copying itself.



More information about the Python-list mailing list