You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new PyFloatObject. This avoids a PyFloat_FromDouble allocation and the subsequent deallocation of the consumed operand on every iteration.
The unique reference tracking infrastructure added in #144300 can be used for the float operations as well. Also see #90530 where a similar optimization was proposed for tier 1 using runtime refcount checks.
Feature or enhancement
Proposal:
When the tier 2 optimizer can prove that an operand to a float binary operation is uniquely referenced, we can mutate it in place instead of allocating a new
PyFloatObject. This avoids aPyFloat_FromDoubleallocation and the subsequent deallocation of the consumed operand on every iteration.The unique reference tracking infrastructure added in #144300 can be used for the float operations as well. Also see #90530 where a similar optimization was proposed for tier 1 using runtime refcount checks.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs