A free lunch

Aug 29, 2011 5 Replies

The Python community is about to offer us a free lunch. A new compliant interpreter, pypy, is already 4.3x faster than cPython, and getting faster everyday. It shows that there is not conceptual reason why high-level dynamic languages should be slow.



For MyHDL, an HDL implemented as a Python library, the results are even more spectacular: my benchmarks run



8-20x faster on pypy. In a single strike, this makes MyHDL simulation performance competitive with Verilog/VHDL.

formatting link



Jan


Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com

Impressive. Do the pypy team have your code to use as a Version Test ?

Did you even try this with your program?

formatting link

Sounds more than one group is speeding up Python.

Failure does not prove something is impossible, failure simply indicates you are not using the right tools... nico@nctdevpuntnl (punt=.) --------------------------------------------------------------

pscyo is an interesting project, and I've used it to speed up Python code. However, the project has been basically dead for 5 years (other than some updated builds for newer python releases on non-Linux platforms), since the guy behind it moved his effort over to the more flexible and future-oriented pypy project. In particular, pscyo is limited to 32-bit x86 cpus, while pypy is aimed at a range of targets - including 64-bit amd64.

In addition, psycho doesn't accelerate generators, which are the name of the game in MyHDL. However, through psycho I got to track Armin Rigo as someone who can do miracles :-)

-- Jan Decaluwe - Resources bvba -

formatting link
Python as a HDL:
formatting link
VHDL development, the modern way:
formatting link
World-class digital design:
formatting link

I don't think they use it now, but they are very aware of the project, and it's all open source, so I'll leave that to their good judgement.

With MyHDL, I found one bug in PyPy 1.5 which has been fixed and added to the PyPy regression test suite, which must be very broad by now.

Jan

Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required