3 ms·
> 64 bit pointers 64 bit pointers was not "optimistic assumptions" about anything, it was just 64 bit pointers on 64 bits systems like most everyone else. And
by masklinn 4y ago
> 64 bit pointers
64 bit pointers was not "optimistic assumptions" about anything, it was just 64 bit pointers on 64 bits systems like most everyone else. And compressed oops were added more than a decade ago (https://wiki.openjdk.org/display/HotSpot/CompressedOops https://wiki.openjdk.org/display/HotSpot/CompressedOops).
For reference that's about when x32 was added to the linux kernel, and unlike x32 compressed oops have not been on the chopping block for 5 years.
> enormous object headers.
Hardly? They're two words a class pointer, and a "mark words" for GC integration.
- marginalia_nu 4y ago> And compressed oops were added more than a decade ago That is still recent on a Java timescale. > Hardly? They're two words a class pointer, and a "mark words" for GC integration. Well compare with for example C++, that can fly commando with no header, just (optional) alignment padding. In many Java objects, the header is more than half the size of the object. That's just not good data locality. The speed-up from switching from an array of objects that has n fields to an object which has an n arrays of fields can be very significant.
- kaba0 4y agoYour array of objects are just tightly packed pointers, so the data locality (or its lack) doesn’t come from that (especially that the order of objects in memory may be different than the order in the array).
- masklinn 4y agoI'm going on a limb as they're going in every direction and trebuchet-ing goalposts, but I'd assume they're talking about using an SoA structure, so instead of having a bunch of Foo objects each with a header and, say, an `int` field (so two words of header for half a word of payload) you have a single header at the top of the array, then an int value per record in the packed array.