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 -- http://mail.python.org/mailman/listinfo/python-list