On Wed, Feb 23, 2022 at 7:11 PM Petr Viktorin <encu...@gmail.com> wrote:
> In the PEP, the "Performance and inlining" section seems unnecessary. It
> talks about attributes that aren't used in the implementation. Or are
> they? How does the section relate to the rest of the PEP?
> The "Benchmark comparing macros and static inline functions" section at
> the end should be enough to explain the impact.

I added this section to the PEP because some core devs believe that C
compilers don't inline static inline functions sometimes and that it
causes performance regressions. This section is an answer to that: I
checked that static inline functions *are* inlined as expected in
practice. The "Benchmark comparing macros and static inline functions"
section uses regular benchmarks to confirm that.

Forcing the compiler to inline or asking the compiler to not inline
has also been discussed multiple times when it was proposed to convert
some macros to static inline functions. So I prefer to put it in the
PEP to avoid people having to dig into old discussions to have
scattered information about that.

You may want to dig into links from the PEP to see old discussions.
See for example https://bugs.python.org/issue35059 for the first
discussion on forcing inline or not.

Victor
-- 
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/YVW7ULTTC6FNTOLL2BPNQOOV3NMCH4BK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to