Psyco performance

danmcleran at yahoo.com danmcleran at yahoo.com
Tue Jun 20 18:09:23 CEST 2006


I'm not seeing much benefit from psyco (only 5-10% faster). Maybe this
example is too trivial? Can someone give me some pointers as to what
kind of code would see a dramatic benefit?

Here's the code:

import time
import psyco

n = 100000

t1 = time.clock()
l = list(range(0,n))
l2 = [x**2 for x in l]
t2 = time.clock()
no_psyco = t2 - t1

psyco.log()
psyco.full()

t1 = time.clock()
l = list(range(0,n))
l2 = [x**2 for x in l]
t2 = time.clock()

with_psyco = t2 - t1

print 'without psyco = ',no_psyco
print 'with psyco = ',with_psyco
print 'delta = ',(((no_psyco - with_psyco)/no_psyco) * 100),'%'




More information about the Python-list mailing list