Archived

This topic is now archived and is closed to further replies.

Telamon

Programming Language Benchmarks

Recommended Posts

So maybe "benchmark" is the wrong word. I''m looking for direct performance comparisons between Java (Sun VM vs. IBM VM), C++, and C# at different tasks (math, networking, databases, ect.) Is there a canonical site for such comparisons? It''s general knowledge that "C is fast" or "Java is as slow as hell", but I''m curious about how they stack up quantitatively - like "C++ is 3.5x faster at floating point math than C#" Thanks for any pointers!

Share this post


Link to post
Share on other sites
Well, google for the programming language shootout. But keep in mind that such benchmarks are usually wrong, always misleading, and never useful.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
For networking and large databases, the speed depends on the network connection and the database engine. Data manipulation is generally where different languages get different speeds. Comparing how long it takes to perform various operations on different types of data structures would be much more informative. As Sneftel said, such benchmarks are never really usefull because they rely on a person knowledgable in all languages, and how much manual optimization should be allowed is pretty much an arbitrary decision.

Share this post


Link to post
Share on other sites
The shoot-out test the free compilers, and it''s a little out-of-date now too. i.e. gcc 3.2 is not used nor MSVC etc. for the C nor C++ specs. Same for Lisp, Fortran, etc... - it''s not the commercial grade compilers that are benchmarked.

Standard C and C++ are both rather slow at floating-point mathematics. You have to leave the bounds and requirements of the standard to go fast (e.g. ignore rounding and precision guarantees, truncate denormals, allow NaN & Inf conditions, etc...).

If you compare standard C or C++ to C# & Java floating-point performance I think you''ll find they are comparable (assuming the Java code has been JIT''ed, and we know the C# code will be).

Performance between compilers can and will vary a great deal, xsp for Java and C++.

Share this post


Link to post
Share on other sites
It''s been my experience that floating point ops in c# is slower than it is in c++. I would assume the same holds for java.

I''ve heard that java forces rounding to 64 bits(or 32 if using floats) after every floating point operation to guarantee bit-reproducible results across all platforms. If that''s true, that would explain a performance difference.

quote:

Standard C and C++ are both rather slow at floating-point mathematics.


Compared to what? Fortran? C and C++ are probably the fastest modern languages at FP.

Share this post


Link to post
Share on other sites