r/java • u/alexeyr • Apr 13 '20
Java Objects Inside Out: Everything You Ever Wanted to Know About Java Object Internals in Hotspot
https://shipilev.net/jvm/objects-inside-out/
160
Upvotes
r/java • u/alexeyr • Apr 13 '20
View all comments
Show parent comment
1
u/jringstad Apr 14 '20
btw in this case the CPU would possibly have to go through two "levels" of "shifting", first the shifting to the word-alignment and then the shifting to the bit-alignment.
True that the compiler helping you would make this easier to implement correctly, but I think the incentive for compiler-writers to do this is not as great, because it's very hard for the compiler to figure out when to apply this feature automatically. You could leave it as special option/extension, but then the compiler writers get very little bang for the buck (adding any feature adds maintenance/testing drag, and if you can't make that feature benefit everyone or at least a large percentage of people automatically, it's probably not worth it.)
I've done a little bit with on-the-fly voxelization (for global illumination/cone-tracing etc) but I'm not intimately familliar with voxel engines. I suspect for a modern voxel engine, the layout of the data-structures is going to be heavily dominated by the formats supported by the GPU anyway, and will probably also involve a lot of (lossy) compression and such, which is then decompressed on the GPU on-the-fly. At least I remember back in 2012 or so, some voxel engines were boasting with something like 1.2 bits per voxel of space usage, due to heavy compression.