3 ms·
> "it’s quicker than using interface types, trust us During runtime, the program doesn't know the actual type of the variable, it just knows it's a io.Reader
by styluss 5y ago
> "it’s quicker than using interface types, trust us
During runtime, the program doesn't know the actual type of the variable, it just knows it's a io.Reader and dereferences to the actual type vs generating the code for the type that is actually being used.
Here's an interesting read on issues with interfaces at scale
https://segment.com/blog/allocation-efficiency-in-high-performance-go-services/ https://segment.com/blog/allocation-efficiency-in-high-perfo...