Experimental variant of BINARY_ADD specialization. by markshannon · Pull Request #29059 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we'll see any speedups from this. I don't see how it will be much faster than PyNumber_Add. If the compiler's smart about it, it'll probably inline PyNumber_Add during PGO, and we'll have almost the same function
Comment on lines +2205 to +2206
| Py_DECREF(sum); | ||
| sum = NULL; |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to consider replacing this with
| Py_DECREF(sum); | |
| sum = NULL; | |
| Py_SETREF(sum, NULL); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or:
| Py_DECREF(sum); | |
| sum = NULL; | |
| Py_CLEAR(sum); |