miller:
> Is there any simple/easy/elegant way to retain a reference to the
> *unoptimized* version of f so I can call them both and compare
> performance?

A simple solution is to defer the optimization. That is test the
original code, call Psyco, then test it again:

def somefunc():
    ...

from time import clock
t0 = clock()
somefunc()
print clock() - t0
import psyco
psyco.bind(somefunc)
t0 = clock()
somefunc()
print clock() - t0

Bye,
bearophile
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to