psyco question

2008-02-03 Thread miller . paul . w
Say I have a module with a function f in it, and I do psyco.bind (f) 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?I've tried f2 = copy.deepcopy (f) psyco.bind (f) but that doesn't work. Other

Re: psyco question

2008-02-03 Thread Marc 'BlackJack' Rintsch
On Sun, 03 Feb 2008 10:06:04 -0800, miller.paul.w wrote: Say I have a module with a function f in it, and I do psyco.bind (f) 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? What about

Re: psyco question

2008-02-03 Thread miller . paul . w
Thanks for your reply. It's been a while since I've used psyco, and it seems either some functions have been added, or I've never needed the other ones. :-) For the record, it looks like psyco.bind (f) f2 = psyco.unproxy(f) would leave me with an optimized f and a function f2 which is the

Re: psyco question

2008-02-03 Thread bearophileHUGS
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

Re: psyco question

2008-02-03 Thread miller . paul . w
On Feb 3, 2:19 pm, [EMAIL PROTECTED] wrote: simple solution is to defer the optimization. That is test the original code, call Psyco, then test it again: I had thought of that, but it didn't really meet my requirements. I might want the unoptimized function back at some point after I call the