3 ms·
Something to keep in mind when microbenchmarking virtual calls is that compilers will happily devirtualize them whenever possible.
by tux3 5y ago
Something to keep in mind when microbenchmarking virtual calls is that compilers will happily devirtualize them whenever possible.
- vlovich123 5y agoYeah I’m aware but I made sure the same devirtualization would apply in production too so the compiler doing any devirtualization was good. It was a bit surprising that vtables outperformed std::variant (and I had tried implementing my own hand rolled equivalent of that too).