[pypy-dev] Performance challenge of mutating class variables
Armin Rigo
arigo at tunes.org
Tue May 17 13:24:31 CEST 2011
Hi David,
On Sun, May 15, 2011 at 5:21 PM, Armin Rigo <arigo at tunes.org> wrote:
>> Did you try this with PyPy 1.5 or a recent nightly? I thought that the new
>> type __dict__ implementation should have fixed the problem?
>
> Indeed, with a recent PyPy things are much better. My example
> still takes 1.5x time the time it takes on CPython 2.7, though...
Well, I cannot reproduce this number... I have no clue how I got it :-(
The original code you posted is actually not relevant to the JIT: it
contains no loop. The fact is that it is still 2-3x faster on PyPy
than CPython, for GC reasons: our GC is better at handling quickly
growing heaps, and the allocated objects are much smaller anyway.
The code I posted used to be really slow in pypy-1.5, because it was
trying again and again to JIT it. Now we fixed the issue, and it is
again much faster than CPython (this time, about 10x).
A bientôt,
Armin.
More information about the pypy-dev
mailing list