On 4/5/20 3:23 AM, Andrea Corallo wrote: > what about having a new macro to control the key operations we want to > always have inlined at -O0 and -Og instead of falling back into defining > these as macros? I looked into this some more, and found some problems with using __attribute__((always_inline)), such as GCC complaining that it can't inline some functions in some cases on some platforms. It was a pain to suss out what would improve performance while avoiding the warnings, and while fiddling with this a bit I found a simpler change that had even better performance than __attribute__((always_inline)) did, at least on one platform for my standard benchmark of 'make compile-always'. So I installed the two attached patches instead. Together they improve Emacs CPU performance for 'gcc -Og' by about 60% on my benchmark. I kept the DEFINE_KEY_OPS_AS_MACROS stuff because of the -O0 performance issues that we discussed earlier. Once we no longer need to worry about -O0 performance when debugging, we can get rid of that stuff. Thanks for suggesting inlining as a way to improve Emacs performance when compiled with -Og.