3 ms·
The vtable for an object being actively used will be in L1 cache, and when a virtual function is called in a loop, Intel's CPUs have been able to predict the ta
by plorkyeran 11y ago
The vtable for an object being actively used will be in L1 cache, and when a virtual function is called in a loop, Intel's CPUs have been able to predict the target for many, many years. ARM may not; I've never had recent to deeply investigate virtual call performance on iOS.
Finding calling via a function pointer to be faster than calling directly suggests that you were not actually measuring what you thought you were measuring.