5 ms·
Only computation-heavy code will show a difference. And the disparity is going to vary a lot. Some code will be easy for Java's optimizer and won't give C++ any
by mtdewcmu 12y ago
Only computation-heavy code will show a difference. And the disparity is going to vary a lot. Some code will be easy for Java's optimizer and won't give C++ any advantage.
- cbsmith 12y agoSome will even put C++ at a disadvantage.
- hatred 12y agoOut of curiosity any such examples ?
- cbsmith 12y agoOf course there are, and it only takes a few seconds with Google to find them. Here's one: the frannkuch-redux benchmark at http://benchmarksgame.alioth.debian.org/u64q/java.php http://benchmarksgame.alioth.debian.org/u64q/java.php gives Java a >20% CPU efficiency advantage over C++.
- igouy 12y agoThat compares a Java program written to use multiple cores with a C++ program not written to use multiple cores; because the C++ programs written to use multiple cores did not compile. See http://benchmarksgame.alioth.debian.org/u64q/performance.php?test=fannkuchredux http://benchmarksgame.alioth.debian.org/u64q/performance.php...