GJ wrote:
> The performance can be DEGRADED by making a function "inline". Is it TRUE > in any case ?
Yes.
When I mean what scenario ?
If the function gets called from many places, too much inlining can increase
code size significantly, which will lower the cache efficiency on systems
that do use caching (which is the majority these days). On modern
workstation-like computers, the cache is extremely important for fast code
execution. Reading a value from RAM can take several hundred clock cycles.
Similarly, if there is conditional code or a loop in the inline function,
the branch prediction unit gets stressed more.
Unfortunatly, this is not an effect that you can simply measure on a per
function basis to find out whether inlining it is faster or not. It's more
like a tendency, and it likely depends on the CPU model, even for different
CPUs of the same architecture.