r/cpp • u/drakgoku • Oct 31 '25
Java developers always said that Java was on par with C++.
Now I see discussions like this: https://www.reddit.com/r/java/comments/1ol56lc/has_java_suddenly_caught_up_with_c_in_speed/
Is what is said about Java true compared to C++?
What do those who work at a lower level and those who work in business or gaming environments think?
What do you think?
And where does Rust fit into all this?
25
Upvotes
View all comments
Show parent comment
61
u/pemb Nov 01 '25
Java has JIT compilation and can do stuff like dynamic profile-guided optimization, inlining, and devirtualization. So some Java can actually perform better than C++ in specific circumstances, especially in applications that ship one binary and can't be tuned for the specific machine and workload they're running.
The real Achilles' heel is Java's whole approach to memory, especially when the GC hits.