[pypy-dev] Scrapy fails in PyPy

Maciej Fijalkowski fijall at gmail.com
Thu Dec 13 22:21:17 CET 2012


On Thu, Dec 13, 2012 at 10:47 PM, Amaury Forgeot d'Arc
<amauryfa at gmail.com> wrote:
> 2012/12/13 Stefan Behnel <stefan_ml at behnel.de>
>>
>> My intuition was to add a fastpath to Py_DECREF() that would do (close to)
>> nothing if the PyPy object is still alive. Either that, or move this whole
>> decision into C by somehow increasing the C level refcount during the
>> lifetime of the PyPy object and decreasing it when the PyPy object dies.
>
>
> It may be difficult, because most standard types don't have a __del__,
> and I'm not sure we can attach a weak reference.

having tons of weakrefs is also a bad idea (or tons of objects with __del__s)

>
>>
>> The latter approach (if doable) is obviously preferable from a C point of
>> view because it would improve the hit-count of the "common case" tests in
>> the INCREF/DECREF C macros, thus avoiding unnecessary calls into PyPy all
>> together by using inlined code. That would give it about the same speed as
>> in CPython for objects that are being reused in C code more than once for
>> which a PyPy object reference exists (certainly not an unusual case).
>
>
>
>
> --
> Amaury Forgeot d'Arc
>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
>


More information about the pypy-dev mailing list