Move type checks from switch cases to beginning of _Py_Specialize_BinaryOp
#128310
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
_Py_Specialize_BinaryOp
:cpython/Python/specialize.c
Lines 2380 to 2443 in aeb9b65
uses
check inside every switch case which is redundant. Placing this check before switch results in same performance but less generated code. Compiler with -O3 option seems to not recognize it. Attaching generated machine code (clang, apple silicon) for old and new versions
new.txt
old.txt
Feel free to close this if not worth it.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
_Py_Specialize_BinaryOp
#128311The text was updated successfully, but these errors were encountered: