Quote (Minkomonster @ May 7 2014 06:24pm)
That is hardly a sufficient test.
If you want to benchmark you are going to need to target the aspects of the language which produce the performance gains.
For java this would be things like:
Garbage collection: complex memory management requires complex garbage collection. Java has HotSpot.
Platform targetting: c/c++ is compiled before hand which means it must know the processor ahead of time. This means unless your app is run on a single known processor, you are better off coding s one size fits all. Java uses JIT compilation which basically compiles at runtime, which means it will know the exact processor it is running on. This allows it to apply processor specific optimizations dynamically.
Libraries: Sun/Oracle have built an excellent, performany library for ADTs and common functions. Which are not only easy to understand but also easy to use. The STL is not. Although die hard C++ programmers will argue against this, it is widely accepted that Javas libraries trump C++
Coming back to your test, lets bring up the fact that Oracle's JVM iswritten in C++. This means that given enough time money and engineering you can make C++ as fast or faster than Java. With that said, the reason simple programs that do nothing more than print a statement or run a couple loops will always favor C/C++. Once you break away from that, you allow the langagues performance to shine.
Sure I wont deny all that but having done a little Cpp with the Qt library it did seem to be more reactive to me than when I do some Swing. But dont get me wrong I love java too

Edit: might be that Ive always coded on somewhat poor machines too, be it at school or at home, perhaps the vm needs much more resources to run as fast as cpp
This post was edited by m0hawk on May 7 2014 11:51am