Comment by nasretdinov
4 hours ago
That is true. Moreover, in general the performance of generic code in Go isn't any better than interface-driven one. Generics are there in Go just for better type safety, and IMO that's sufficient already :)
4 hours ago
That is true. Moreover, in general the performance of generic code in Go isn't any better than interface-driven one. Generics are there in Go just for better type safety, and IMO that's sufficient already :)
It's all tradeoffs. Fully monomorphized generics tend to blow up compile time.
Full monomorphization can also greatly increase code size and icache pressure. Especially if LTO was not possible.
I haven’t seen icache pressure causing performance degradation in the wild but it is in theory possible.