While we should not seriosly compare JAVA and C++ performance

While trying to find some libraries for RDF/OWL stuff I noticed that most of the software in this area is written in Java. This raised a question about the performance of such applications. Since OWL data can be pretty complicated especially for the reasoning software the performance becomes a critical factor.

So I was wondering, why people choose Java for implementing such things.

It looks like currently Java is getting credits for being almost equal or even faster to C++ in terms of performance in numerical calculations (see http://www.idiom.com/~zilla/Computer/javaCbenchmark.html).

Actually, what makes sense for me here is the way how question is stated. The question of performance here is equal to the comparison between
almost incomparable things like “who is stronger: a boxer or a karate guy?”.

We cannot set such question because it is obvious that:

  1. Strong C++ coder will write faster code than strong JAVA programmer.
  2. Novice C++ coder will write same or slower code than novice JAVA programmer.

However, the important statement which actually stays behind the
decision between Java and c++ is:

Average JAVA coder will code faster than average C++ coder.

The strong points of JAVA versus C++ is the simplicity, maintainability and portability.
While C++ program can also be portable, it is harder for the novice user to build and adapt the code for a specific platform.

I believe this is a major point taken into account when a pilot application or library is being developed.

Seriously, the only code which works faster than good C implementation would be hand optimized asm version.

2 Responses to “While we should not seriosly compare JAVA and C++ performance”

  1. Tom Barta says:

    Particularly in the context of RDF/OWL, I think it doesn’t matter too much. XML parsing is fairly heavy, enough so that I would argue that you should reconsider either the file format or (more importantly) your algorithm before reconsidering the implementation language.

  2. Alex says:

    Unfortunately the parsing of OWL document is not the dominant task. The reasoning (logical entailment, inference) is the main problem. You can search for an article “Benchmarking OWL Reasoner”, there are some figures about Java and C++ reasoners. In overal both are bad :) but C++ is still much faster.

RSS feed for comments on this post. And trackBack URL.

Leave a Reply