The reason is that there is a dynamic jump, which leads to failure of branch prediction and emptying of the pipeline. Imagine that if it is not a virtual function, the relative address of the function is fixed during the compilation period, and the compiler can directly generate the JMP/invoke command; If it is a virtual function, the overhead of finding a vtable is secondary. The key is that the function address is dynamic, for example If the obtained address is in eax, all the commands that have been prefetch into the pipeline after calling eax will become invalid. The longer the pipeline, the higher the cost of a branch failure prediction. PF-> test (); 011e146d mov eax, dword ptr [pf] 011e1470 mov edX, dword ptr [eax] 011e1472 mov ESI, ESP 011e1474 mov ECx, dword ptr [pf] 011e1477 mov eax, dword ptr [edX] 011e1479 call eax <------------------------- branch prediction failure 011e147b cmp esi, ESP 011e147d call @ ILT + 355 (_ rtc_checkesp) (11e1168h) |