If I have a class containing many Extension Methods, should I worry about the overhead of “using” it if I’m only using one of those Extension Methods?
If this is the case, should I perhaps put all Extension Methods in their own classes? Or perhaps there is a way to “use” a single Extension Method? (E.g., something like: using StringMethods.RecursiveJoin;?)
If I have a class containing many Extension Methods, should I worry about the
Share
It likely increases the compile time very very slightly. And there is no runtime overhead at all. So no reason to worry from a performance point of view.
The only thing I’d worry about is whether the design is good. Should all of those methods really be extension methods, or are some of them better off as normal static methods or even instance methods? But that question can’t be answered without knowing what your extension methods do.