Ok, yeah, that’s a fair point, and to be honest this criticism applies to any kind of “best effort” optimization pass, not just generic specialization. Elision of ARC traffic suffers from similar issues due to performance cliffs as well. It seems the solution we’ve settled on for the latter is to encode this in the type system itself using move-only values and types, and perhaps one day we can investigate a similar approach to force specialization of generics or error out when it can’t be done.
However I also think that performance of unspecialized runtime generics is not a totally lost cause either, and there’s work we can do to make it faster. It will never be as fast as specialized code but perhaps if we narrow the gap it will be less of an issue.