[Python-ideas] Wordcode v2, moved from -dev

Demur Rumed gunkmute at gmail.com
Sun Feb 21 08:35:29 EST 2016


Continuing discussion from
https://mail.python.org/pipermail/python-dev/2016-February/143357.html

I'm currently waiting for abarnert to accept my PR:
https://github.com/abarnert/cpython/pull/1 which fixes tests. The only
really failing test (ie which doesn't also fail on my stock python) is
test_importlib since it seems I don't know how to update frozen modules or
something

Antoine wanted to know what I benchmarked. Fact is that I haven't been
rigorous; I'm comparing Archlinux's stock python to my ./configure && make.
That said pybench is 20s on stock python compared to 17s on wordcode

On the matter of bytecode projects having to be updated, I've updated my
Befunge Python JIT. I post some analysis in my PR on why this particular
benchmark should go in the old one's favor @
https://github.com/abarnert/cpython/pull/1#issuecomment-186679849

Current funge.py: https://github.com/serprex/Befunge/blob/master/funge.py
Wordcode wfunge.py: https://github.com/serprex/Befunge/blob/master/wfunge.py

Stock python runs Mandelbrot in 30s vs 28s on wfunge, & 3.3s vs 2.9 for
beer6.bf (Mandel is a benchmark of generated code, whereas beer6 is mostly
a benchmark of the JIT recompiling

This also serves to demonstrate that current projects can be updated quite
straightforwardly, worst case they change to always emitting EXTENDED_ARG
for opcodes >= STORE_FAST

In the pull request I've removed HAVE_ARGUMENT. I believe this'll help in
porting things to fail-fast since HAVE_ARGUMENT's usage in code essentially
must change, but perhaps one could add \x90 back as a constant named
DOES_NOT_IGNORE_ARGUMENT

I'd like to ask someone who isn't involved in development of this branch to
verify my benchmark results
Befunge-93 programs I mentioned:
http://quadium.net/funge/downloads/bef93src/beer6.bf
http://quadium.net/funge/downloads/bef93src/mandel.bf

Still to do is at least investigate halving opargs for jump instructions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160221/4ab48908/attachment.html>


More information about the Python-ideas mailing list