Article - A benchmark of 9 popular languages

Started by
34 comments, last by sark 20 years, 3 months ago
Here is an article posted on Slashdot comparing the mathematical ability of nine popular languages. Visual C++ is the winner, Visual C# comes second followed by gcc C. The top 3 contenders come in quite closely. Sadly Python looses, by quite a long shot. It may interest the speed trolls around here that both C# and Java 1.4.2 outperforms Visual C++ in some respects.
Advertisement
Java...and...math???
Interesting, but a bit of a shame he didn''t benchmark using any algorithms like a quicksort, or a bubble sort at least. Some string manipulation tests would have been nice, like a simple parser.

Its probably the strongest argument for using what you are comfortable with in a long time.
Benchmarking features in isolation is one thing. It would be nice to see a comparison of a large system written in each language, using best practices for each. There are macro-issues that aren''t taken into account in these kinds of benchmarks.

--
Dave Mikesell Software & Consulting
another consideration that seems to NEVER be considered is application developement time. While Python may be slower in execution, there are many things that are a hundred times faster in developement that in C++. The fact that C++ has no built in string data type means that time must be spent on creating a solution. Granted, stl::string solves this for us, but there are many data types that are not, or perhaps the stl version is not desired (I don't really like stl::stack. It doesn't return on pop, which is counter-intuitive to me)

I've only barely touched Python, but the things that I have done with it in a mere 15 minutes would have taken me 3 hours in C++ (and I know 50 times more C++). I can stand a program executing in 3 seconds instead of .3 seconds, if I saved 2.75 hours in developement time.

edit: I wonder why Java 1.4.2's trig is so slow? It would seem ready to compete with C++ if they could fix that.

[edited by - capn_midnight on January 9, 2004 3:42:40 PM]

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Pretty limited test, it didn''t even include Delphi.
Besides, it''s not the 80s anymore (even though C makes us feel like that anymore). We''re not working with 4-byte integers or pointers only. A benchmark that tests double math doesn''t say much about the language.
Uhm, what the fuck does Visual have to do with C++. The GCC version of C++ is the same as MS''s, if not more standards compliant.
quote:Sadly Python looses, by quite a long shot.

Sadly, but unsurprisingly. Python''s speed was as in many other benchmarks. 35 times slower than C++ by default, 15 times slower with Psyco. That doesn''t stop it from being used in Freedom Force, Blade of Darkness and Eve Online. It just needs to be used in the least performance dependent code (and there''s lots of that in all projects).
quote:Original post by dmikesell
It would be nice to see a comparison of a large system written in each language, using best practices for each.
Yeah, but unreasonable.
quote:Original post by Puzzler183
Uhm, what the fuck does Visual have to do with C++. The GCC version of C++ is the same as MS''s, if not more standards compliant.
The latest VC++ (7.1) is the most standards compilant compiler AFAIK. It produces faster code in general than GCC, thus it was used here.
quote:Original post by capn_midnight
edit: I wonder why Java 1.4.2''s trig is so slow? It would seem ready to compete with C++ if they could fix that.

tealwarrior said this in Slashdot:
"For many math functions java uses a software implementation rather than using the built in hardware functions on the processer. This is to ensure that these function perform exactly the same on different architectures. This probably accounts for the difference in performance."

Sad.. It''d be good to have a compiler option for "less accurate float operations" that''d use hardware for this stuff.

This topic is closed to new replies.

Advertisement