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.
Worthless Benchmark
by Anonymous on Sun 11th Jan 2004 04:31 UTC

A lang. benchmark is not going to be very useful in this context. As numerous people have pointed out, you need a benchmark that will simulate more of what you need your code todo in a given project, to see if there's any performance benefit from switching to another lang. This will generally, be different for each project. Not to mention, this is more of a compiler benchmark, then a lang. benchmark, and GCC's claim to fame, is portabilty, not optimization, especially for non-x86 arch's (Sun's Compilers, and SGI's MIPSpro compilers will give you a binary that usually performs about %300-%500 Better than a gcc built binary, since I don't use x86 hardware much, I am not an expert in what compiler you should use to benchmark on that platform, but I would imagine Intel's compiler to be leaps and bounds ahead of gcc in optimization.

Thus the blanket assurtion that C shouldn't be used for speed anymore is wrong, and then adding that the code is less maintainable, is absurd. People have been maintaining C source far longer than most other languages in such wide use (Fortran/etc. the execption, and they still have their place as well). The Best lang is often times, the one the programmer is most familiar with, but C can generally be optimized much better than other languages (C++ included.), although some languages, like fortran, are easier for the compiler to parallize for MP's (take into account SGI's -apo options) for multiple reasons beyond the scope of this comment.