psyco out of memory

Tim Hochberg tim.hochberg at ieee.org
Thu Aug 5 17:59:43 EDT 2004


Ivan Voras wrote:
> Ivan Voras wrote:
> 
>> (I'm running python 2.3.4 on FreeBSD 5)
> 
> 
> Hmph. I tried on WinXP and it works. Maybe it's a platform-specific bug.
> 
> (Still, I'm surprised how slow it is. The same "program" in Java takes 
> about 10sec, and here it's passed 5 minutes and I'm still waiting...)

I believe that psyco only accelerates functions and methods. So, it's 
not going to do anything in the case you presented. This makes it 
particularly suprising that it broke. Try wrapping up your loop in a 
function. And with Psyco range is (or at least used to be) better. Like so:

import psyco

def f():
     d = 0.0
     for i in range(1000000000):
         d += i
     print d
psyco.bind(f)

f()

That ran in about a minute here. Psyco won't speed up floating point 
operations near as much as integer ops at present, hence its speed 
deficit with respect to java.

-tim




More information about the Python-list mailing list