[issue45116] Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC)

neonene report at bugs.python.org
Sat Oct 16 11:26:06 EDT 2021


neonene <nicesalmon at gmail.com> added the comment:

msg402954
>https://github.com/faster-cpython/tools

According to the suggested stats and pgomgr.exe, I experimentally moved LOAD_FAST and LOAD_CONST cases out of switch as below.

        if (opcode == LOAD_FAST) {
            ...
            DISPATCH();
        }

        if (opcode == LOAD_CONST) {
            ...
            DISPATCH();
        }

        switch (opcode) {


x64 performance results after patched (msvc2019)

Good inliner ver.
    3.10.0+    1.03x faster than before
    28d28e0~1  1.04x faster
    3.8.12     1.03x faster

Bad inliner ver. (too big evalfunc. Has msvc2022 increased the capacity?)
    3.10.0/rc2 1.00x faster
    3.11a1+    1.02x faster


It seems to me since quite a while ago the optimizer has stopped at some place after successful inlining. So the performance may be sensitive to code changes and it could be possible to detect where the optimization is aborted.

(Benchmarks: switch-case_unarranged_bench.txt)

----------
Added file: https://bugs.python.org/file50363/switch-case_unarranged_bench.txt

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45116>
_______________________________________


More information about the Python-bugs-list mailing list