Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Runtime Performance Vs Native C / C++ Code?
    text
    copied!<p>I've become more and more comfortable programming in Java than with C++ or C. I am hoping to get a sense of the performance hit incurred using a JVM interpreter, as opposed to executing the same "project" natively. I realize that there is some level of subjectivity here; the quality of the program will depend highly on a good implementation. I'm interested in the following aspects in a general sense:</p> <ul> <li><p>There must be some baseline for overhead when using an interpreter. Is there some general rule of thumb to remember? 10% 15%? (I pulled these numbers out of thin air) I have read the occasional blog stating that Java code is nearly as fast as native code, but I think that may have been biased. </p></li> <li><p>Does the JVM garbage collector add significant overhead to runtime performance? I know Cocoa applications have begun to use a garbage collection model, and i agree that it makes programming a lot simpler, but at what cost?</p></li> <li><p>What is the overhead of making system calls from Java? For example creating a Socket object as opposed to the C socket API. </p></li> <li><p>Finally, I recall reading somewhere that the JVM implementation is single threaded. If this is true (which i am skeptical about), does that mean that Java threads really aren't true threads? Does a java thread, in general, correspond to an underlying kernel-provided thread? Does a Java application benefit in the same way a native application would from multiple cores / multiple cpu's? </p></li> </ul> <p>Any advice from developer who understands the intricacies of JVM and java program performance would be much appreciated. Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload