Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


This is mentioned in the memory layout section in the post.


I'm not sure what "a marker" is and how to make it take 0 bits of storage.


This 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.


You mean non-nullable object types then. Which are faster and take up less space because that's how the hardware works :)


They'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: