3 ms·
Isn't the indirection overhead of a []byte more expensive than a spare 12 inline bytes?
by ben0x539 10y ago
Isn't the indirection overhead of a []byte more expensive than a spare 12 inline bytes?
- dbaupp 10y agoYes, and a []byte is even going to have at least as much inline overhead: it stores 24 bytes (length, capacity, pointer), and of course plus the 4 bytes of actual data. Even on a 32-bit platform, the []byte inline storage is 12 bytes.