Linked by Christopher W. Cowell-Shah on Thu 8th Jan 2004 19:33 UTC
General Development This article discusses a small-scale benchmark test run on nine modern computer languages or variants: Java 1.3.1, Java 1.4.2, C compiled with gcc 3.3.1, Python 2.3.2, Python compiled with Psyco 1.1.1, and the four languages supported by Microsoft's Visual Studio .NET 2003 development environment: Visual Basic, Visual C#, Visual C++, and Visual J#. The benchmark tests arithmetic and trigonometric functions using a variety of data types, and also tests simple file I/O. All tests took place on a Pentium 4-based computer running Windows XP. Update: Delphi version of the benchmark here.
Permalink for comment
To read all comments associated with this story, please click here.
Python numbers
by error27 on Fri 9th Jan 2004 09:05 UTC

Python is in these tests because it has to look up the variable each time.

For example: i = i + 1. In Python i is a word that is stored in a hash that points to an pointer. In the C code it's just a memory location on the stack. Of course, the slow down does affect real life but maybe not as much as it affects this benchmark.

The Long test is unfair for Python because Python has true big number support (based on how much memory you have). In C and Java long is around 64 bits only. In those languages there are special libraries for really large numbers. Apple to oranges type situation.

Python does OK in the trig test because all those functions are implemented in C. It still suffers from the variable name look up problems though.