There are a lot of articles on the Internet to illustrate the performance of Java optimization of the good words are not lost C + +, and some are through some actual code testing to illustrate, but in some tests are obviously cheating
This article is not intended to be discussed in long speeches, but simply to illustrate some of the truth
Why is it that few people doubt the efficiency of C + +, and why is Java always suspected, and why is there not much doubt about scripts like python,php?
Java will not be a man, the first line of life, see after Good xx. Java always want to be perfect, any field want to plug a foot, as a perfect language, how can fall behind the performance, this many do not face, so there is a ridiculous thing, always want to prove in the performance with C + + in a level, and each version of the update will say that performance has a great upgrade, After all these years of ascension, the result? Can only cheat some people who don't really want to be in the crowd.
GC is a major problem in Java performance
In fact, the truth should be the reverse, not the GC affects Java performance, but Java corrupt GC reputation, GC and Malloc/free are dynamic memory management method, the application of memory operation is basically the same, the difference is to choose the timing of the release of the problem, usually the GC release action automatically triggered , but the implementation does not prohibit manual triggering, just some language refused to do so, automatic memory management must not be optimal, full manual can have the opportunity to do the best, many times semi-automatic is a better choice. This does not want to discuss the GC implementation in detail, just want to objectively point out that the GC should be correctly recognized, more about GC content, please refer to: http://www.iecc.com/gclist/GC-faq.html
JIT can achieve the same speed as C + +
Can only say that the JIT can improve the speed of Java, but does not mean that the JIT can be achieved and C + + speed, the reason is very simple, the compiled language is not only C + +, did not say that it can achieve the speed C/ For C language efficiency is the first, in order to efficiency can abandon many advanced features, and other languages for the characteristics can lose performance, this is the fundamental problem
Java popularity proves that the Java language is good enough
There are many reasons for the popularity of language, the reality is that language is not good enough not to affect the most popular reasons, but the support of commercial companies, the results of interest-driven, so the popularity is not a standard for evaluating the quality of language, but a reference value
A compilation run everywhere is the biggest Java
That's for scripting, it's going to be run all the time, and there's no script that says it's an advantage, and why Java can take this out for a while, and a lot of people actually write it all over again.
Java inherits the advantages of C + + and also discards some of the drawbacks of C + +
I can only say that the biggest advantage of C + + is the second only to C language performance, with C-like platform control ability, almost seamless compatible with C (this is controversial, in fact, this is also the history of C + +), this is the competitiveness of C + +, Java has not inherited, just in the language features to do some articles, on this , Python,ruby and other languages may be more acceptable.
Java is simple.
This is a word since the advent of Java, but also often cited by some books, can only say that Java is simpler than C + +, but does not mean simpler than C + + is called simple, because there is no language that is more difficult than C + +
Write so much for the time being, what else would you like to add
Finally: Java always like and C + + ratio, in fact, there is no comparability, from the syntax, can recognize the C + + grammar design good people are not many, from this point with C + + grammar can not prove the grammar design good. different domains, C + + is a system programming language, C + + is synonymous with technology and performance (performance is one of its important goals, and C + + users are required to understand the platform-related technology to be used well), and Java is the application layer language, is synonymous with the ideal idea (hardware can improve performance , platform technology does not need to be understood, theoretically the JVM can provide everything, Java can do anything)
A rumor about the long-term Java performance