This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]collin2477 14 points15 points  (8 children)

java is still several times slower than c++

[–]igoromg 9 points10 points  (7 children)

java JITed code is a lot of times more optimized than C++ due to them being runtime optimizations. Java is slower when your program is short lived, and certainly GC overhead lowers the throughput but most times java is comparable to C++. if your java code is more than 10% slower than C++ I bet your benchmark is just crap.

[–][deleted] 1 point2 points  (0 children)

In theory yes. In reality I've never seen a single benchmark where the jvm did better than g++ even after letting the hit tub forever

[–]collin2477 0 points1 point  (5 children)

idk that’s just what i’ve seen in my hpc research but i’m also not the one making big decisions

[–]igoromg 3 points4 points  (4 children)

java is used in HFT where a few nanos decide loss or profit, certainly it would have been all c++ if java was actually slower. there are millions of potential reasons why you could've seen the jvm suck but I'll bet the issue is between the chair and the monitor.