|
|
|
|
|
by _Codemonkeyism
3929 days ago
|
|
10x speedup (same algorithms, same architecture) replacing Java with C++ is not possible (~2x at max). One of the latest benchmarks I've seen is "Comparison of Programming Languages in Economics" [1] for code without any IO just number crunching, has a 1.91 to 2.69 speedup of using C++ compared to Java. So any code involving IO is going to be slower. Replacing bad Java code with excellent machine aligned C++ a 10x speedup is possible. [1] https://github.com/jesusfv/Comparison-Programming-Languages-... |
|
Java has a ton of overhead that C++ doesn't. Each object has metadata which results in more "cold data" in the cache. Each object is a heap allocation (unless you're lucky enough to hit the escape analysis optimization), which again leads to less cache locality because things are distributed around memory. Then there's the garbage collector. Then bounds checking.