Hacker News new | past | comments | ask | show | jobs | submit login

> a byte array is in reality layed out as a (mostly empty) long array in Java

Are you saying each byte takes up a word? That is the case in the `char array` in OCaml, but not Java's `byte[]`. AFAIK The size of a byte array is rounded up to words. Byte arrays of length 1-8 all have the same size in a 64-bit machine, then length 7-16 take up one more word.

https://shipilev.net/jvm/objects-inside-out/






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

Search: