]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #21955: Please don't try to optimize int+int
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 20 Oct 2016 10:18:10 +0000 (12:18 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 20 Oct 2016 10:18:10 +0000 (12:18 +0200)
Python/ceval.c

index b50ad3c26397212125f1bc2fc81b35bf0c68a90b..2df94cfa8068f15d460c6f023dae78ccd2832ed4 100644 (file)
@@ -1424,6 +1424,12 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
             PyObject *right = POP();
             PyObject *left = TOP();
             PyObject *sum;
+            /* NOTE(haypo): Please don't try to micro-optimize int+int on
+               CPython using bytecode, it is simply worthless.
+               See http://bugs.python.org/issue21955 and
+               http://bugs.python.org/issue10044 for the discussion. In short,
+               no patch shown any impact on a realistic benchmark, only a minor
+               speedup on microbenchmarks. */
             if (PyUnicode_CheckExact(left) &&
                      PyUnicode_CheckExact(right)) {
                 sum = unicode_concatenate(left, right, f, next_instr);