mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Issue #21955: Please don't try to optimize int+int
This commit is contained in:
parent
24f33b5bb5
commit
d65f42a132
1 changed files with 6 additions and 0 deletions
|
@ -1424,6 +1424,12 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
|
||||||
PyObject *right = POP();
|
PyObject *right = POP();
|
||||||
PyObject *left = TOP();
|
PyObject *left = TOP();
|
||||||
PyObject *sum;
|
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) &&
|
if (PyUnicode_CheckExact(left) &&
|
||||||
PyUnicode_CheckExact(right)) {
|
PyUnicode_CheckExact(right)) {
|
||||||
sum = unicode_concatenate(left, right, f, next_instr);
|
sum = unicode_concatenate(left, right, f, next_instr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue