Speed Comparison Perl Python & C

ciw42 ciw42 at hotmail.com
Tue Mar 2 19:44:48 EST 2004


Even the most basic optimising compiler would turn your example Fortran
increment variable loop into a few basic machine code instructions operating
on hardware registers, which combined with the internal cache would keep the
entire loop inside the processor avoiding memory bandwidth issues etc. It's
not surprising you're getting such dramatic ratios, but it's hardly a real
world example.

Compiled optimised code will (should) always be significantly faster than
interpreted code, but you lose all of the benefits of using a language such
as Python in the process, so it's all rather pointless comparing languages
in this way.

I've spent over 20 years coding all manner of languages - assembly, BASIC,
COBOL, C/C++, VB, Delphi etc. and speed of execution is of little or no
concern in 99% of the projects I work on, especially these days. If it were
the be-all and end-all of development I'd still be coding in assembly.



More information about the Python-list mailing list