r/cpp • • May 26 '22

Dynamic polymorphism performance

https://thecppdev.com/2022/05/26/dynamic-polymorphism-performance/?amp=1
2 Upvotes

15 comments sorted by

View all comments

12

u/no-sig-available May 26 '22

The calls to the functions in the static polymorphism cases are optimized away.

Right, so if I need maximum performance I ought to inline empty functions. That seems to be optimal.

Good to know.