[pypy-dev] cpyext performance

wlavrijsen at lbl.gov wlavrijsen at lbl.gov
Tue Jul 10 21:02:54 CEST 2012

Hi Stefan,

> Ok, then in the case of a callback, the runtime could simply start with
> totally stupid code that packs the low-level arguments into Python
> arguments, attaches the low-level type information to them and then passes
> them into the function. The JIT should then see in its trace what types
> originally came in and optimise the argument packing away, shouldn't it?

no, don't think so: the JIT works by seeing code execute (the "tracing" part
of it), so with the above recipe, there's still a chicken-and-egg problem.
That is, in order to JIT, the code in the callback needs to be executed, but
to execute, the trace entry point is needed, but for that, the JIT needs to
run ... circle. :/

I was more thinking of an automated equivalent of the toolchain:


with annotations provided programmatically. But if that worked cleanly on
pypy-c, I'd have expected separable "builtin" modules already. :)

Best regards,
WLavrijsen at lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net

More information about the pypy-dev mailing list