News for hackers. Stuff that matters.
Re:Java 17 / JDK 17: General Availability by nlitened on Tuesday September 14, 2021 @12:19PM (#28527039)
> If I can move gigabytes of my data into arrays of structs, then 1) I greatly reduce memory requirements (far fewer pointers), and 2) I greatly reduce the amount of work that GC has to do.

As an aside, and not to say that Valhalla is not needed (I am looking forward to it very much, along with Loom), I’ve recently learned that for many use cases (not all) when you want gigabytes of struct arrays, a bunch of equal-sized primitive arrays, one per struct field, might work even better from memory requirement and cache locality perspective.

Re:Java 17 / JDK 17: General Availability by samus on Tuesday September 14, 2021 @11:33PM (#28534946)
The semantics of primitive types should make it possible for the JVM to apply this optimization automatically. Maybe controlled via an annotation. But no clue whether it's on the roadmap.