4 ms·
How does it compare against c/c++ in terms of performance ?
by nadioca 8y ago
How does it compare against c/c++ in terms of performance ?
- pjmlp 8y agoOf course it is a bit slower, as Java does not take advantage of UB nor disabling security checks for the ultimate performance. And depending on the use case there is always the issue of value vs reference types. But it is good enough for most use cases of typical desktop software, to the point of Oracle's long term roadmap is to rewrite the remaining C++ parts of OpenJDK in Java (Project Metropolis), using a subset they are designing called System Java. Also can check Android flagship devices (better for performance comparison), since Android 5.0, Java is also AOT compiled to native code. Although Android 7 changes it to a mix of interpreter written in Assembly, JIT and AOT with PGO. And Android P will introduce sharing of PGO metadata across devices via Play Store.
- stefs 8y agothe native executables native-image generates are usually a bit slower than hot-spot JIT'ed code (~10% on average according to one article). they do need much less RAM and startup time is _a lot_ lower though. here it is: "Right now peak performance is a bit worse than HotSpot, but we don’t want to advertise that (and we want to fix it of course)." http://www.graalvm.org/docs/reference-manual/aot-compilation/ http://www.graalvm.org/docs/reference-manual/aot-compilation...