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

Skip to content

Commit fba1cfc

Browse files
committed
LIST_APPEND is predicably followed by JUMP_ABSOLUTE.
Reduces loop overhead by an additional 10%.
1 parent 6e058d7 commit fba1cfc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,10 @@ eval_frame(PyFrameObject *f)
12311231
err = PyList_Append(v, w);
12321232
Py_DECREF(v);
12331233
Py_DECREF(w);
1234-
if (err == 0) continue;
1234+
if (err == 0) {
1235+
PREDICT(JUMP_ABSOLUTE);
1236+
continue;
1237+
}
12351238
break;
12361239

12371240
case INPLACE_POWER:
@@ -2061,6 +2064,7 @@ eval_frame(PyFrameObject *f)
20612064
break;
20622065
continue;
20632066

2067+
PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
20642068
case JUMP_ABSOLUTE:
20652069
JUMPTO(oparg);
20662070
continue;

0 commit comments

Comments
 (0)