[New-bugs-announce] [issue5375] Unified locals/consts array + register-based instructions

Antoine Pitrou report at bugs.python.org
Thu Feb 26 15:08:54 CET 2009


New submission from Antoine Pitrou <pitrou at free.fr>:

There is no patch here, this entry is just a reminder of some of the
ideas that have been suggested to experiment with ways to speedup the
Python VM (djc, who is nosied, has said he'd be willing to try working
on it):

- unify the local variables and constants arrays (this costs a copy of
the constants array at each frame creation, but it should be negligible
since frames are reused and the copy can probably be a dumb memcpy)
- devise new instructions, or a whole new instruction set, which takes
its arguments from this array

As a simple way to experiment, one could start with a new instruction
named e.g. BINARY_ADD_FAST which would take one 16-bit arg, whose 8
upper bits would be the index of the first argument, and whose 8 lower
bits would be the index of the second argument. The result would be
pushed on top of the stack.

It could also be measured whether having a special value (255) to mean
"pop the argument off the pop of the stack" gives negative (because of
overhead) or positive (because of less bytecode) results.

----------
components: Interpreter Core
messages: 82756
nosy: collinwinter, djc, jyasskin, pitrou
priority: normal
severity: normal
status: open
title: Unified locals/consts array + register-based instructions
type: performance
versions: Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5375>
_______________________________________


More information about the New-bugs-announce mailing list