От: | snaphold | ||
Дата: | 24.05.17 04:37 | ||
Оценка: |
The difference in efficiency here is incredible. Let’s look at the ArrayList first, con-
sidering a 32-bit CLR.7 Each of the boxed bytes will take up 8 bytes of object overhead
plus 4 bytes (1 byte, rounded up to a word boundary) for the data itself. On top of that,
you have all the references themselves, each of which takes up 4 bytes. So for each byte
of useful data, you’re paying at least 16 bytes—and then there’s the extra unused space
for references in the buffer