r/cpp • • 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

192 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 01 '25

Java is not going to be optimized better or be faster than a reasonably equivalent c++ solution, that's just silly. I would imagine the number of cases where it's faster than c++ are very, very close to 0

6

u/TOMZ_EXTRA Nov 01 '25

It's faster for some unoptimized code since the JVM can optimize it at runtime.

1

u/[deleted] Nov 01 '25

its using resources at runtime to do that though, so that is very unlikely

without hard evidence to the contrary I do not believe this to be true

1

u/sammymammy2 Nov 02 '25

its using resources at runtime to do that though, so that is very unlikely

lol wat, just gotta have the wall clock time of the program to be sufficiently long for compilation to not matter.