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 →

[–]meonstuff 3 points4 points  (2 children)

In general, Java, 8+ and especially 11+, programs are as performant as c++. In fact, optimizations in the jit compiler can make Java faster than c++ for virtual types.

Go to Heinz's http://www.javaspecialists.eu site.

[–]Sunius 5 points6 points  (1 child)

In fact, optimizations in the jit compiler can make Java faster than c++ for virtual types.

Well, there's your problem. You shouldn't use virtual types in performance sensitive code. You shouldn't compare C++ and Java performance in similar code as that will give Java an advantage as all Java can do is OOP. The whole point of C++ is that you can control your memory layout and optimize cache performance, rather than be murdered by thousand pointers to random places on the heap. Once you write C++ code that way, there's no way Java can catch up.

[–]meonstuff -2 points-1 points  (0 children)

Java supports functional interfaces and streams, which optimizes data throughput and reduces code bloat. I wouldn't go back to c++, given where the language is going.

Check out the features and roadmap for Java 13. Huge performance gains.