
On Tue, 23 Nov 2021 18:00:28 +0100 Victor Stinner <vstinner@python.org> wrote:
From what I understood, debug builds are mostly used by Python core developers to develop Python and so an important use case for performance is running the Python test suite.
(1) Replacing macros with static inline functions makes Python 1.04x slower when the compiler **does not** inline static inline functions: gcc -O0.
That is fine with me :-)
I didn't run benchmarks on Python built in release mode, since gcc -O3 with LTO and PGO should inline all static inline functions and I don't expect any difference between macros and static inline functions.
That would actually be interesting, since there can be surprises sometimes with compilers... (function inlining depends on heuristics, for example, and there may be positive or negative interactions with other optimizations) Regards Antoine.