请问.Net Compact 3.5 virtual calls是什么意思?
.Net Compact 3.5 的优化中有这样的一段描述: 请问其中的virtual calls具体指的是什么,是否是我们简单工厂中,利用接口的里氏替换原则,用父类接口承接实例,通过父类接口调用实例方法的做法?
Avoid virtual calls. The .NET Compact Framework runtime virtual calls are approximately 30 percent slower than static or instance calls. The .NET Compact Framework does not use vtables because of constrained resources, so methods must be called by traversing the class and interface hierarchy, which is an expensive operation. The .NET Compact Framework maintains a cache of resolved virtual calls, so in most cases calls do not need to be reinterpreted.