xrange question

Greg Ewing see at my.signature
Tue May 8 06:22:03 CEST 2001


Paul Prescod wrote:
> 
> I think on my machine xrange starts to "win" around 2000.

It seems to be very machine-dependent. I just tried your program
on two machines here. The faster one gave results similar to
yours, but on the slower one, by 5 they're very close, and
xrange starts to win at about 20.

By the way, does anyone know why xrange isn't at least as
fast in *all* cases? Considering that creating and indexing
a tuple involves doing everything that creating and indexing
an xrange object involves, plus more besides, I don't see
why xrange should ever be slower.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list