Specialize BINARY_OP by refcount and by type of operands #117581
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Instead of the fairly limited ad-hoc specialization we currently use, we should specialize
BINARY_OP
by refcount and use table lookup to specialize by type.Doing so would have the following advantages:
BINARY_SUBSCR
intoBINARY_OP
freeing up several tier 1 opcodesCONTAINS_OP
andCOMPARE_OP
to free up more tier 1 opcodesI expect the overall performance impact on tier 1 will be negligible. Maybe a little bit faster, maybe a little bit slower.
The improved specialized will (I expect) largely cancel out the degraded performance for the most common operations.
See for faster-cpython/ideas#662 detailed analysis and faster-cpython/ideas#660 for the related tier 2 optimization
Linked PRs
The text was updated successfully, but these errors were encountered: