Re: Performance comparison Q

Jean-Claude Wippler <[email protected]> Mon, 9 May 2005 21:43:07 +0200
Newsgroups gmane.comp.db.metakit
Message-ID <[email protected]>
Magnus Lie Hetland wrote:

>> result = sum(xrange(50000))
>
> I just did a simple experiment (using the timeit module) comparing
> the performance of sum(range(50000)) and sum(xrange(50000)), and the
> latter gave a speedup factor of about 2.2 on my computer... Also,
> allocating a list of size 50000 seems a bit wasteful just for
> computing this sum :)

The point is not the result (25000*49999 will get there a lot faster).

I'm trying to see how a list of values, iteration over it, and a  
simple integer operator work together in each particular language.

Don't quite see the same speedup for xrange, but as I said it is not  
the issue here for me.

-jcw

_____________________________________________
Metakit mailing list  -  [email protected]
http://www.equi4.com/mailman/listinfo/metakit