[Metakit] Performance comparison Q
Magnus Lie Hetland
magnus at hetland.org
Mon May 9 22:58:20 CEST 2005
Jean-Claude Wippler <jcw at equi4.com>:
>
[snip]
> The point is not the result (25000*49999 will get there a lot
> faster).
Of course. I'm sorry -- I misread your original request (didn't read
the code thoroughly enough). I thought you just wanted to add the
numbers (i.e., those specific numbers) and see how long it took.
> I'm trying to see how a list of values, iteration over it, and a
> simple integer operator work together in each particular language.
I see.
> Don't quite see the same speedup for xrange, but as I said it is not
> the issue here for me.
Indeed. I'd recommend trying a plain for-loop together with psyco if
you're running on an x86 machine. Armin Rigo (its author) has
outperformed the built-in list sort method in Python by a naive
Quicksort implementation + psyco, for example. Psyco is really good
with lists of integers (because it translates the code directly into
machine language operations on integer arrays, instead of going
through Python objects, which the built-ins like list.sort() or
reduce() must do).
Sorry again for missing the point ;)
--
Magnus Lie Hetland Fall seven times, stand up eight
http://hetland.org [Japanese proverb]
More information about the Metakit
mailing list