[pypy-dev] RinohType and PyPy2
Brecht Machiels
brecht at mos6581.org
Sun Mar 2 11:11:43 CET 2014
Thanks Maciej,
sys._getframe was introduced by "magicsuper", which I used to avoid refactoring all super() calls. I've done that now and there shouldn't be any more sys._getframe calls. You can pull in this commit from the pypy2 branch.
Unfortunately, this didn't improve performance much. PyPy now takes 26 seconds. Any other ideas?
Best regards,
Brecht
---- On Sun, 02 Mar 2014 08:19:35 +0100 Maciej Fijalkowski wrote ----
>the first obvious thing that jumps at me is your casual use of
>sys._getframe - the JIT aborts in this case and proceeds to the
>interpreter (so you pay the price for JITting, while you also pay the
>prace for not having compiled assembler). That probably does not
>explain everything, but please don't use sys._getframe in production
>code if you want the JIT to be fast.
>
>On Sun, Mar 2, 2014 at 12:34 AM, Brecht Machiels
wrote:
>> Hello,
>>
>> I've managed to backport RinohType to Python 2 (took me only a couple of hours thankfully).
>>
>> Results on my Celeron T3000 (Arch Linux x86_64):
>> CPython 3.3.4 14 s
>> PyPy3 2.1.0-beta1 61 s
>> CPython 2.7.6 15 s
>> PyPy 2.2.1 35 s
>>
>> If you want to give it a try (no external dependencies):
>>
>> git clone --branch pypy2 https://github.com/brechtm/rinohtype.git
>> cd rinohtype/examples/rfic2009
>> rm -rf template.ptc; PYTHONPATH=../.. pypy template.py
>>
>>
>> While PyPy2 performs better than PyPy3, it's still much slower than CPython. Is RinohType hitting a weak spot in PyPy? Any hints on what I can do to improve performance?
>>
>> Best regards,
>> Brecht
>>
>>
>> _______________________________________________
>> pypy-dev mailing list
>> pypy-dev at python.org
>> https://mail.python.org/mailman/listinfo/pypy-dev
>
More information about the pypy-dev
mailing list