
I downloaded psyco yesterday and did some tests (Python 2.1, P3/866). It works! Basically, the key point is that you need to psyco.bind on the right functions. Doing psyco.gc() just slows things down. It takes a bit of testing to find out which functions to do it on. Results: pystone without psyco: 9000 pystone with psyco: 32000!!! (I did psyco.bind(Proc0) in psytone.py) pystone with psyco.gc(): 4500 So pystone can speed things up by a factor of 3 on meaningless benchmarks ;) I also got a small speedup in twisted.web - 305-320 hits/second instead of 275-285 hits/second, by doing psyco.bind on the function that runs select.select() (Twisted's equivalent of asyncore.poll()).

Itamar> Basically, the key point is that you need to psyco.bind on the Itamar> right functions. Sounds like a job for hotshot: http://starship.python.net/crew/fdrake/talks/IPC10-HotShot-2002-Feb-06.ppt http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Lib/ho... Itamar> Doing psyco.gc() just slows things down. Not sure what psyco.gc is (I don't see it after importing psyco), but I got 3.7x speedup binding Proc0, Proc1, & Proc8. I also instrumented Proc0 to make sure the values of IntLoc1, IntLoc2, and IntLoc3 were the same before and after psyco-izing. Skip

Skip Montanaro wrote:
Itamar> Basically, the key point is that you need to psyco.bind on the Itamar> right functions.
Sounds like a job for hotshot:
http://starship.python.net/crew/fdrake/talks/IPC10-HotShot-2002-Feb-06.ppt http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Lib/ho...
Not exactly. I tried binding functions hotshot said were using a lot of CPU time, and it didn't always help. But certainly hotshot helped finding which ones to try. On the subject of hotshot - I made a command line hotshot profiler so you can use it easily, as with the standard profiler (download it from http://itamarst.org/software/). It's great! Unlike the standard profiler the results are much nearer to reality since the profiler isn't using half your CPU time. Doing some testing, I noticed some results that were obviously wrong. A function that is listed as using 2 seconds of time, when a consequent run only said 0.003 or something. Since this was a function that basically did: if self.tasks: return 0.0 else: return None and it was run a similar number of times (and no threads), I suspect the 2 seconds result was totally bogus. Unfortanutely I didn't remember to keep the hotshot logs. This happened at least twice that I noticed.

Itamar Shtull-Trauring wrote:
Results: pystone without psyco: 9000 pystone with psyco: 32000!!! (I did psyco.bind(Proc0) in psytone.py) pystone with psyco.gc(): 4500
So pystone can speed things up by a factor of 3 on meaningless benchmarks ;)
3.5. ;-) Hey! If you're measuring something meaningless, might as well measure it accurately. -- --- Aahz (@pobox.com) Hugs and backrubs -- I break Rule 6 <*> http://www.rahul.net/aahz/ Androgynous poly kinky vanilla queer het Pythonista We must not let the evil of a few trample the freedoms of the many.
participants (3)
-
aahz@rahul.net
-
Itamar Shtull-Trauring
-
Skip Montanaro