New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance for switch in ceval.c when using MSVC #91719
Labels
Comments
gvanrossum
added a commit
that referenced
this issue
Apr 21, 2022
Apparently a switch on an 8-bit quantity where all cases are present generates a more efficient jump (doing only one indexed memory load instead of two). So we make opcode and use_tracing uint8_t, and generate a macro full of extra `case NNN:` lines for all unused opcodes. See faster-cpython/ideas#321 (comment)
Fixed by #91718. |
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Apr 25, 2022
Move internal C API from Include/opcode.h to a new Include/internal/pycore_opcode.h file. Move: * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Apr 25, 2022
Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
vstinner
added a commit
that referenced
this issue
Apr 25, 2022
Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
vstinner
pushed a commit
that referenced
this issue
Apr 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
We've received reports of MSVC not generating optimal code, e.g. gh-89279.
One possible improvement would be to get the big switch statement in ceval.c to generate better code. It's been rumored that MSVC will generate essentially a computed goto if all cases are filled.
See my investigations at faster-cpython/ideas#321 (comment)
The text was updated successfully, but these errors were encountered: