Re:Making a Go program 70% faster with a one character change
by account42 on Tuesday November 15, 2022 @04:31AM
(#33607099)
Even for a 32-bit CPU a 64-bit type is only two words to copy - and in many cases those "copies" are just register loads. In contrast, reference types means to even access it you have to read the reference and then indirectly load the memory it points to. You have to really make something contrived where a two-word type ends up being more efficient as a reference than as a value.
[ Parent
| on HN ]
There are no comments on this comment yet.