Lightning Talk: Virtual Functions Are Not Slow - Rud Merriam - CppNorth 2023

  Рет қаралды 1,284

CppNorth

CppNorth

Күн бұрын

Пікірлер: 5
@GreenJalapenjo
@GreenJalapenjo Жыл бұрын
Hmm, I don't think this is completely fair. It's a bit hard to tell because the slides aren't there, but when people say "virtual functions are slow", they don't usually mean "virtual functions are slower than function pointers". Sometimes, you *need* runtime polymorphism, and virtual functions are good then (though reducing virtual calls is still good). But often, you can make a choice between runtime polymorphism and static polymorphism (e.g templates), and runtime polymorphism is usually the slower option there.
@babgab
@babgab Жыл бұрын
Someone should let Casey Muratori know :D
@thelatestartosrs
@thelatestartosrs Жыл бұрын
I think the argument is more about if you have chains of virtual functions which can be avoided if you only compute the type once through your std::variant usage.
@sparker2426
@sparker2426 Жыл бұрын
If a switch statement is as slow as a virtual function call then the compiler isn't doing its job.
@higaski
@higaski Жыл бұрын
Just because you can doesn't mean you should. Are you going to rewire the Arduino during runtime? Most likely no, then why pay for any overhead at all? Hardware simply isn't virtual.
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 76 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 21 МЛН
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 65 МЛН
Derek Jones - "Benchmarking C++ compilers" - C++ London
44:29
C++ Reflection: Back on Track - David Olsen
1:03:25
CppNorth
Рет қаралды 914
C++ is a Metacompiler - Daniel Nikpayuk
54:27
CppNorth
Рет қаралды 605
Sigma baby, you've conquered soap! 😲😮‍💨 LeoNata family #shorts
00:37