On Saturday, 2 March 2013 at 15:43:57 UTC, Russel Winder wrote:
On Sat, 2013-03-02 at 10:33 -0500, Andrei Alexandrescu wrote:
[…]
That conclusion would be hasty if not missing the whole point.
You essentially measured the speed of one loop in various
translators implementing various languages. Java code doing
straight computation is on a par with C speed, no two ways
about that. Python code using library primitives ain't no
slouch either. Performance tuning in these languages becomes
more difficult in larger applications where data layout,
allocation, and indirect function calls start to dominate.
[…]
Interestingly, there isn't only one Python implementation.
There is only
one language but there is CPython, PyPy, Jython, IronPython, to
mention
but 4.
On computationally intensive code, PyPy (Python execution
environment in
RPython) is generally 10 to 30 times faster than CPython (Python
execution environment written in C).
C is a (reasonably) well known and used language thought to
create fast
code. RPython is Python but with some restrictions that is
statically
compiled. For writing interpreters, RPython spanks C. PyPy is
not the
only language using RPython to implement the interpreter. C's
days in
this game are seriously numbered.
I'm not sure that's entirely fair. PyPy is fast because it
implements a JIT, not because it's written in RPython.