4 ms·
It's weird to argue that null is how the hardware works. Many structs contain only bytes that are allowed to take on any value, so making them nullable takes ex
by anonymoushn 3y ago
It's weird to argue that null is how the hardware works. Many structs contain only bytes that are allowed to take on any value, so making them nullable takes extra space.
- invalidname 3y agoThis is mentioned in the memory layout section in the post.
- anonymoushn 3y agoI'm not sure what "a marker" is and how to make it take 0 bits of storage.
- invalidname 3y agoThis is an upcoming behavior in Valhalla which isn't yet a part of Java so there's nothing final. Currently Valhalla has primitive and value object types that determine identity behavior.
- anonymoushn 3y agoYou mean non-nullable object types then. Which are faster and take up less space because that's how the hardware works :)
- invalidname 3y agoThey're not faster for all cases. Near memory works great for some edge cases such as looping on an array of data in a block. This is very much a special edge case. For many other non-benchmark situations this isn't so simple. If you add the overhead of memory copying and lack of identity things are more complex.