[Python-Dev] Register-based VM for CPython

Armin Rigo arigo at tunes.org
Sat Nov 17 11:17:40 CET 2012

Hi Victor,

On Sat, Nov 17, 2012 at 2:13 AM, Victor Stinner
<victor.stinner at gmail.com> wrote:
> The major drawback of the register approach (at least of my implementation)
> is that it changes the lifetime of objects. Newly created objects are only
> "destroyed" at the exit of the function, whereas the stack-based VM destroys
> "immediatly" objects (thanks to the reference counter). PyPy has similar
> issues with its different garbage collector.

That is not strictly correct.  PyPy, Jython and IronPython have
non-immediate destructors, but as far as I can tell they all avoid to
keep objects alive for an unbounded amount of time.  This important
difference is visible if the function calls other code that takes a
long while to run: in your approach, the objects created by the
function itself will stay alive for the whole duration, while the
other interpreters will all release them soon after they are not
referenced any more --- not instantly like CPython but still soon.

A bientôt,


More information about the Python-Dev mailing list