Dr. David J. Pearce

Java versus C++ Performance


Recently, I came across an interesting discussion of C++ versus Java performance over on Stack Exchange. There was also some good discussion of the article on Reddit which included a link to an interesting article from Google.

Understanding these languages from a performance perspective is important to me, as it impacts the design of Whiley. So, I thought I’d highlight the main strands from that article and the subsequent discussions, and also add a few points I think were missed:

My general feeling is that performance remains a critical issue for language design.  Many people say “machines are fast enough” or that “with a sufficiently smart compiler…”, etc.  In practice, these things never come to pass because the goalposts themselves are moving.  For example, web applications must routinely scale up to millions of hits a day (or more), compared with tens of thousands only a few years ago.  And, in the future, we’ll demand even more.

Finally, the focus on memory utilisation as a fundamental performance bottleneck makes me question the future of pure object-oriented languages.  Today, these language appear to be back in vogue (e.g. Scala, Ruby, etc).  But, I just wonder whether these languages will be able to deliver the performance needed for the future …

Thoughts?