[Python-Dev] Python 3 optimizations continued...

Cesare Di Mauro cesare.di.mauro at gmail.com
Wed Aug 31 07:14:08 CEST 2011


2011/8/30 stefan brunthaler <stefan at brunthaler.net>

> Yes, indeed I have a more straightforward instruction format to allow
> for more efficient decoding. Just going from bytecode size to
> word-code size without changing the instruction format is going to
> require 8 (or word-size) times more memory on a 64bit system. From an
> optimization perspective, the irregular instruction format was the
> biggest problem, because checking for HAS_ARG is always on the fast
> path and mostly unpredictable. Hence, I chose to extend the
> instruction format to have word-size and use the additional space to
> have the upper half be used for the argument and the lower half for
> the actual opcode. Encoding is more efficient, and *not* more complex.
> Using profiling to indicate what code is hot, I don't waste too much
> memory on encoding this regular instruction format.
>
> Regards,
> --stefan
>
That seems exactly the WPython approach, albeit I used the new "wordcode" in
place of the old bytecode. Take a look at it. ;)

Regards

Cesare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110831/f47910e0/attachment.html>


More information about the Python-Dev mailing list