News for hackers. Stuff that matters.
Re:Java for Everything (2014) by kaba0 on Monday April 26, 2021 @04:03PM (#26947326)
> But handling state efficiently is Java's weak spot. Objects are tiny fragments scattered around the heap.

All mainstream JVM GCs are compacting, but I agree that without “value” types, an ArrayList for example will point to objects that can hurt performance. But that’s why you profile, if a given part is a hotspot, then you can rewrite it as an array of primitives. But due to compacting, allocating objects randomly in C++ vs in Java, Java will likely win.

And valhalla is coming, and with primitive types, the JVM will have a way for that last piece of performance.

There are no comments on this comment yet.