Optimizing Away C++ Virtual Functions May Be Pointless - Shachar Shemesh - CppCon 2023
CppCon CppCon
147K subscribers
13,421 views
0

 Published On Mar 7, 2024

https://cppcon.org/
---

Optimizing Away C++ Virtual Functions May Be Pointless - Shachar Shemesh - CppCon 2023
https://github.com/CppCon/CppCon2023

We all know that Virtual Functions Should Be Avoided. A great many tutorials exist for replacing virtual functions with compile-time polymorphism mechanisms, such as std::variant and templates. But is that feeling justified? Are virtual functions truly slower? By how much? Does it matter for your particular use case? What costs do their alternatives carry?

In this lecture we'll try and understand where that impression came from, what virtual functions do that make them slower and how all of that interacts with modern CPU architectures. We'll also explore the limits of benchmarks for answering those questions.

This lecture may not supply you with answers, but it will supply you with better questions.
---

Shachar Shemesh

Shachar Shemesh has been programming computers since the 8-bit era, and still finds passion in it today. Shachar's professional career has taken him to security, networking, storage and video streaming.
Outside his professional career Shachar is... also programming. He has several open source projects to his name, and is lately working on creating his childhood computers, from scratch, on low-cost FPGAs.
Shachar also plays the saxophone. Not necessarily well.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: https://events.digital-medium.co.uk
---

Registration for CppCon: https://cppcon.org/registration/

#cppcon #cppprogramming #cpp

show more

Share/Embed