[Python-Dev] Re: [Psyco-devel] Re: [Zope-Coders] Psyco release 0.4.0 (original) (raw)

Armin Rigo arigo@ulb.ac.be
Sun, 10 Mar 2002 18:00:05 +0100


Hello Petru,

----- Original Message -----

> Jup, Zope is about 3.5 times slower with psyco. > Any explanations for this worse behaviour ?

Just a wild, wild guess: this could be related to Psyco not doing the regular interval polling, so PyThreadStateSwap() doesn't get called as often as it should, ZServer piles up requests, the worker threads get starved, and so on.

Morten's results give a more interesting answer. He went from a serious slowdown to a 2x speed-up by replacing psyco.jit() with psyco.bind() on a pair of classes. So the problem probably stands in the just-in-time rebinder, psyco.jit(). Not only does it add a constant profiling-like overhead (significantly more important in Python 2.1 than 2.2, by the way), but I believe that there are quite a few problems with its current approach.

Would someone please make another check on Zope+Psyco without using psyco.jit() ? A few carefully selected psyco.bind() could give quite more positive speed-ups. I don't know exactly how to select what to bind, however. Maybe testing various combinations and relating them with data from profiling could give a hint at more general usage patterns that could be eventually formalized in a more involved implementation of psyco.jit().

Thanks,

Armin