3 ms·
Well, the alternative to vtables is manually branching (besides completely rewriting the code to avoid different actions), which isn't that much better and stil
by dzaima 5y ago
Well, the alternative to vtables is manually branching (besides completely rewriting the code to avoid different actions), which isn't that much better and still requires branch prediction. And I think JVMs also might convert a dispatch from two classes to a conditional branch, but I'm not sure.
- nayuki 5y agoYes: https://shipilev.net/blog/2015/black-magic-method-dispatch/#_three_types_and_beyond https://shipilev.net/blog/2015/black-magic-method-dispatch/#...