3 ms·
The 50% was for a microbenchmark of C++ code making heavy use of virtual. V-tables and jump tables get much more expensive. Any execution path that is known at
by TheCycoONE 9y ago
The 50% was for a microbenchmark of C++ code making heavy use of virtual. V-tables and jump tables get much more expensive. Any execution path that is known at compile time is not affected.
- nikanj 9y agoI wonder where that leaves Java, C#, Node.js etc. Do the VMs generate code that suffers from this?
- DannyBee 9y agoyes
- Matthias247 9y agoHmm, interesting question. On the hand JITs do devirtualization, so that on lots of code paths the indirect calls are replaced with direct ones. Which should mitigate the performance issues. However I think the JITs also need to insert the logic and branches for re-jitting and spectreulative execution. These might be additional indirect calls. Would be interesting how it balances out in total.