Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d65f42a

Browse files
committed
Issue #21955: Please don't try to optimize int+int
1 parent 24f33b5 commit d65f42a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Python/ceval.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,12 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
14241424
PyObject *right = POP();
14251425
PyObject *left = TOP();
14261426
PyObject *sum;
1427+
/* NOTE(haypo): Please don't try to micro-optimize int+int on
1428+
CPython using bytecode, it is simply worthless.
1429+
See http://bugs.python.org/issue21955 and
1430+
http://bugs.python.org/issue10044 for the discussion. In short,
1431+
no patch shown any impact on a realistic benchmark, only a minor
1432+
speedup on microbenchmarks. */
14271433
if (PyUnicode_CheckExact(left) &&
14281434
PyUnicode_CheckExact(right)) {
14291435
sum = unicode_concatenate(left, right, f, next_instr);

0 commit comments

Comments
 (0)