to mark functions for inlining and aggressive inlining. I had originally been liberal with these annotations on pretty much every short function in my engine. However, I just finished a quick test and found that there was essentially no impact from the inline annotations on the resulting code, likely because the optimizer inlines everything that needs to be inlined anyway.
Have you all tried marking your functions for inlining? Did you see any performance improvements?
It kind of helps sometimes, but as you said, in 95% of cases compiler is smart enough to do it itself. And at the same time I've had bad experiences from the time when I was writing Cosette, where aggressive inlining in bad places was very harmful to performance (because more machine code = more pressure on the processor cache).
Does anyone look at the code in Compiler Explorer or a debugger to see which functions actually get inlined vs. which ones are "requested" for inlining? This of course will/should change with different optimization levels.
I learned a long time ago that such things in C (inline for functions and register for variables) are just "suggestions" to the compiler, and I haven't bothered using them since. Indeed, over the decades, compiler optimization has advanced substantially, and using these would be second-guessing an entity smarter than me.