如果不需要访问某对象的字段,将方法设置为静态,调用会加速15%到20%。
If you don't need to access an object's fields, make your method static. Invocations will be about 15%-20% faster.
您可以像调用静态方法一样访问单例对象的方法。
You can access methods on singleton objects similar to how you would call static methods.
如果方法不是静态的,那么就生成将this对象引用装载到堆栈中的代码,同时设置方法调用类型为virtual(而不是static)。
If the method is not static, I generate code to load the this object reference to the stack, and also set the method call type to virtual (rather than static).
应用推荐