Compared to what alternative? In any situation where use of function
pointers is appropriate, the alternative is more complicated than simply
calling the function directly. Example:
fptr = (condition ? func1 : func2);
x = fptr(y);
Could be changed to
x = (condition ? func1(y) : func2(y));
or
x = bigfunc(condition, y);
where bigfunc(true, y) behaves just like func1(y), while bigfunc(false,
y) behaves just like func2(y). Note that either of these approaches
requires storage of the condition that controls the choice, rather than
storage of a function pointer.
There's many other alternatives, as well. Which one are you thinking of?
Isn't this issue deterministic?
No, not in general. It can become deterministic if you're restricting
your attention to one particular machine, and one particular compiler,
running in single-user mode so that the performance does not depend upon
any other programs that might be running at the same time. Also, your
program must not be engaged in any real-time activities such as waiting
on a device, which can have side-effects that influence the performance
even of code that is completely unrelated to the the wait.
... Why should anyone employ empirical methods to try to understand the behavior
of deterministic systems?
Even if you do have a deterministic system, figuring out the performance
penalty by deriving it from the rules governing that system can be
prohibitively difficult and error-prone. Empirical testing is often
simpler and more robust.
In any event, determinism is not the relevant problem; it's the fact
that the answer will, in general, be different on different
deterministic systems.