2 ms·
I wonder if they'd consider changing the bit that indicates whether a word is a pointer or not based on the value rather than the type? Interfaces in Go seem p
by skybrian 8y ago
I wonder if they'd consider changing the bit that indicates whether a word is a pointer or not based on the value rather than the type?
Interfaces in Go seem pretty inefficient for unions of small types. If you have a slice of interfaces, it's all pointers, even if many of the values fit within a word and could be stored inside the interface.
- weberc2 8y agoIIRC they originally were stored inside of the interface, but then the GC would have to check whether they were a value or a pointer and this switching was too costly.