4 ms·
Even if virtual call branches are well predicted, they still have high overhead. Yeah GCC and clang will do what you described in some cases, they will insert
by mgraczyk 4y ago
Even if virtual call branches are well predicted, they still have high overhead.
Yeah GCC and clang will do what you described in some cases, they will insert a check and try to make a non-virtual call when possible. But also as you mentioned, they real advantage is from the downstream optimizations that unlocks, which they cannot do.