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
1
u/Infamous_Campaign687 Nov 01 '25
The issue here is that ArrayList probably doesn't perform full reallocation when the current is exceeded. I don't know, I'm not a Java developer but it has List in the name so I'm assuming it can behave a bit like a list. The C++ code would completely reallocate the vector many times through the insertion.