我的问题与静态方法与实例方法的性能特征及其可伸缩性有关。对于这种情况,假设所有类定义都在单个程序集中,并且需要多个离散的指针类型。
考虑:
public sealed class InstanceClass
{
      public int DoOperation1(string input)
      {
          // Some operation.
      }
      public int DoOperation2(string input)
      {
          // Some operation.
      }
      // … more instance methods.
}
public static class StaticClass
{
      public static int DoOperation1(string input)
      {
          // Some operation.
      }
      public static int DoOperation2(string input)
      {
          // Some operation.
      }
      // … more static methods.
}上面的类表示助手样式模式。
在实例类中,解决实例方法要花一些时间与StaticClass相对。
我的问题是:
- 当不关心保持状态(不需要字段或属性)时,使用静态类总是更好吗? 
- 如果存在大量此类静态类定义(例如,假设有100个静态方法,每个静态方法有多个),那么与相同数量的实例类定义相比,这会对执行性能或内存消耗产生负面影响吗? 
- 当调用同一实例类中的另一个方法时,实例解析是否仍然发生?例如使用[此]关键字等 - this.DoOperation2("abc")从内- DoOperation1相同的实例的。
this当类本身调用实例方法时,编译器会摆脱检查指向某物的问题吗?”