Linked by Christopher W. Cowell-Shah on Thu 8th Jan 2004 19:33 UTC

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.

To read all comments associated with this story, please click here.

The gcc results look so bad because there is something

wrong with the math libraries in MinGW and cygwin.

Being extremely surprised by the fact that the trig

run times with gcc are almost 4 times longer than

with .NET, I redid the trig test with each operation

tested individually. Here the results on a dual boot

2 GHz P4 laptop (WinXP and SuSE Linux 9) using

-O3 -ffast-math -march=pentium4 -mfpmath=sse -msse2

as optimization options in both cases:

WinXP and the cygwin version of GCC 3.3.1:

sin: 1.03 seconds

cos: 1.02 seconds

tan: 10.33 seconds

log: 1.92 seconds

sqrt: 0.20 seconds

all 5 in the same loop: 14.36 seconds

WinXP and MinGW: results essentially identical

SuSE 9 and GCC 3.3.1:

sin: 1.02 seconds

cos: 0.99 seconds

tan: 1.16 seconds

log: 0.57 seconds

sqrt: 0.21 seconds

all 5 in the same loop: 3.59 seconds

Clearly, there is something wrong with the tan and

log functions on cygwin and MinGW.

So, the whole test on Linux:

integer arithmetic: 9.6

long integer: 24.5

double: 8.4

trig: 3.6

I/O: 1

total: 47.1

Someone was interested in the Intel compiler results,

here they are:

integer: 9.0

long integer: 39.9

double: 7.0

trig: 4.4

I/O: 1.1

total: 61.4

=> if you have to use 64 bit integers in your

program, don't use the Intel compiler.