Slower than Python

Russel Winder russel at winder.org.uk
Sat Mar 2 07:43:48 PST 2013


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.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130302/a103a538/attachment.pgp>


More information about the Digitalmars-d mailing list