3 ms·
That's not quite what I said. In languages like C++ or Rust you pay the cost every time the method is invoked. With other types of compiler you may not pay the
by mike_hearn 12y ago
That's not quite what I said.
In languages like C++ or Rust you pay the cost every time the method is invoked. With other types of compiler you may not pay the cost even if the method is marked as virtual, even if it's actually used virtually in other parts of the codebase, due to call site specialisation.
- dbaupp 12y agoThe CPU branch predictor can predict/"specialise" virtual calls too.