File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes java vs c++ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "java vs c++" Watch "java vs c++" New topic
Author

java vs c++

Hendra Kurniawan
Ranch Hand

Joined: Jan 31, 2011
Posts: 239
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

Joined: Aug 22, 2010
Posts: 3611
    
  60

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

Joined: Mar 17, 2011
Posts: 8427
    
  23

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


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java vs c++