• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java vs c++

 
Hendra Kurniawan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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++?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Winston Gutkowski
Bartender
Pie
Posts: 10430
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic