What psyco is goot at [Was: Rookie Speaks]
Armin Rigo
arigo at tunes.org
Thu Jan 15 06:20:29 EST 2004
Hello Timothy,
On Fri, Jan 09, 2004 at 09:51:07AM +1100, Delaney, Timothy C (Timothy) wrote:
> The benchmarks with `from psyco.classes import __metaclass__` are
> interesting - they're counter to what one would expect from the docs -
> increased memory usage and decreased performance. Is this a known thing
> Armin, or is something going screwy on my box? It's happening consistently.
Pystone is a contrieved example of Python code, but I still don't really
understand what is going on here. Psyco is definitely much faster with the
Record class being left as an old-style class, which is the part that I don't
grasp.
> The main functions only get called one time each (which is probably the
> killer) and the bulk of the work is done inside while loops in those
> functions.
Here too I'm not sure what is going on. This should not be the killer,
because psyco.profile() is able to detect that a lot of time is spent in the
loops while they are running, and it can start the compilation in the middle
of the execution of a function. There are several parameters to
psyco.profile(), see the documentation; you could try increasing 'parentframe'
up to 0.5. This has the effect that time spent in sub-function counts a bit
more as time (indirectly) spent in the calling function as well. All these
parameters are a bit arbitrary, so I'd love to hear about values that worked
better for you.
A bientot,
Armin.
More information about the Python-list
mailing list