2 ms·
Personally, this is why I think specialization is a bad idea. It means that minor refactors can have very strange impacts on performance, and that every API now
by jasonhansel 5y ago
Personally, this is why I think specialization is a bad idea. It means that minor refactors can have very strange impacts on performance, and that every API now has an (often undocumented) set of types for which it is unexpectedly much more performant.
- the8472 5y agoYou already get this with optimizing compilers. They do not guarantee to optimize all equivalent patterns equally.
- still_grokking 5y agoWhat would be the alternative? Not specializing at all would make your code awful slow (as you would need some quite complicated and costly treatment of generics at runtime). "Specializing by hand" is not realistically doable besides toy programs. And not having generics in the language at all will result in "solutions" like in Go… I see no way around (semi-)automatic specialization done by the compiler.