This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'd say no one will be able to tell. But since the app is small and computationally intensive, I'd say it would be very little additional work to port it from Java to C++ (or vice versa), so you can actually test and see for yourself.
Java could conceivably be faster. The JIT compiler uses runtime information to recompile critical portions of the code; C++ compiler does not have this kind of information at hand when compiling.
Hendra Kurniawan wrote:let's say I want to make a simple app to generate permutation. which app would run faster on the same machine and OS (intel i3 win 7-32 bit), the one running in java 7 or borland C++?
Like Martin, I doubt if you'd be able to notice. C++ gives you more scope for your own optimization, but less for the compiler; and modern compilers are often far better than we are when it comes to micro-optimization.
Suck it and see...and heed the words of Wulf (see below).
Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here