It's advantageous when you're running on 16 bit hardware 😛
😂 1
e
ephemient
07/07/2023, 10:01 AM
JVM values on the stack are always int- or long-sized
ephemient
07/07/2023, 10:03 AM
the smaller boolean byte and short types are only smaller than int when in a field or array
ephemient
07/07/2023, 10:06 AM
on native, registers are similarly going to be 32- or 64-bit and stack alignment will cause most values to be padded when spilled, so the story is pretty similar
c
CLOVIS
07/07/2023, 12:08 PM
To complete what has been said before: smaller-than-int types mainly exist for storage/network reasons. They are not meant for computation, as computers usually work with 32+bits units anyway.