diff -r f6a89f6cadd0 Python/ceval.c --- a/Python/ceval.c Fri Feb 05 18:26:20 2016 -0500 +++ b/Python/ceval.c Sat Feb 06 02:43:45 2016 +0100 @@ -1591,7 +1607,23 @@ PyEval_EvalFrameEx(PyFrameObject *f, int TARGET(BINARY_SUBSCR) { PyObject *sub = POP(); PyObject *container = TOP(); - PyObject *res = PyObject_GetItem(container, sub); + int slow_path = 1; + PyObject *res; + + if (PyList_CheckExact(container) && PyLong_CheckExact(sub)) { + /* INLINE: list[int] */ + Py_ssize_t i = PyLong_AsSsize_t(sub); + if (i < 0) + i += PyList_GET_SIZE(container); + if (i >= 0 && i < PyList_GET_SIZE(container)) { + res = PyList_GET_ITEM(container, i); + Py_INCREF(res); + slow_path = 0; + } + } + + if (slow_path) + res = PyObject_GetItem(container, sub); Py_DECREF(container); Py_DECREF(sub); SET_TOP(res);