How to decrease the number of possible cache misses when designing a C++ program?
Does inlining functions help every time? or is it good only when the program is CPU
Inlining functions runs can risk harming the instruction cache. And if memory is not fetch bound, then it is unlikely to make much ( if any ) difference.
As always, any optimization should be informed by profiling rather than hunches. Not to mention that you will need to understand what the profiler is telling you which implies familiarity with assembly language and the particular characteristics of the plaftorm you are optimising for.
A bit old now, but Mike Abrash's "Graphic's Programming Black Book" still has lots of good general advice.