Skip to content

FIX: we don't need pointers to interfaces

Choose a tag to compare

@mediocregopher mediocregopher released this 11 Oct 02:16

An interface{} is technically only two words in size no matter what value it's representing. While a pointer is one word in size, the extra hop to dereference the interface is probably worse then just copying two words around everywhere, since it gets rid of memory caching optimizations that are probably happening under the hood. I have no metrics to back this up, but it makes the code simpler so it's happening.