]> granicus.if.org Git - python/commitdiff
_pickle: remove outdated comment
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 24 Aug 2016 22:58:58 +0000 (00:58 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 24 Aug 2016 22:58:58 +0000 (00:58 +0200)
_Pickle_FastCall() is now fast again!

The optimization was introduced in Python 3.2, removed in Python 3.4 and
reintroduced in Python 3.6 (thanks to the new generic fastcall functions).

Modules/_pickle.c

index fed3fa221e7df6de1adca5caac1e8b77ebab89f6..f029ed66456c24e8c6dca804b2f7b4d2aab45481 100644 (file)
@@ -346,17 +346,6 @@ _Pickle_FastCall(PyObject *func, PyObject *obj)
 {
     PyObject *result;
 
-    /* Note: this function used to reuse the argument tuple. This used to give
-       a slight performance boost with older pickle implementations where many
-       unbuffered reads occurred (thus needing many function calls).
-
-       However, this optimization was removed because it was too complicated
-       to get right. It abused the C API for tuples to mutate them which led
-       to subtle reference counting and concurrency bugs. Furthermore, the
-       introduction of protocol 4 and the prefetching optimization via peek()
-       significantly reduced the number of function calls we do. Thus, the
-       benefits became marginal at best. */
-
     result = _PyObject_CallArg1(func, obj);
     Py_DECREF(obj);
     return result;