A question about osyco

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon Jan 28 18:48:13 EST 2008


Marc 'BlackJack' Rintsch:
> Try calling the iterative one twice and measure the time of the second
> call.  IIRC psyco needs at least one call to analyze the function, so the
> first call is not speed up.

That's how Java HotSpot works, but Psyco is very different from
HotSpot, and I think you are wrong.
I don't exactly know the answer to the question of the OP, but I think
the two functions are different: in the second function most time
isn't spent in managing the xrange or in the assign, but in the sum
between long ints, and Psyco can't speed up that operation (you need
gmpy for that, and in certain tricky situations gmpy may even result
slower, maybe when you use small numbers).

Bye,
bearophile



More information about the Python-list mailing list