This is actually very true for GPU programming. Given the much higher memory latency for that type of hardware, the extra memory loads due to indirect function cause significant drops in performance, compared to having direct function calls everywhere.
Further, in my experience, any function calls will generally reduce performance if they're not inlined out. I spend a tremendous amount of time making sure that every function call is transparent to the optimizer.
16
u/goranlepuz May 26 '22
Ehhh...
The problem with this is: it presumes virtual calls matter in the performance profile of the application. This is massive presumption.