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

Skip to content

Commit b98b927

Browse files
committed
_pickle: remove outdated comment
_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).
1 parent 53cb489 commit b98b927

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

Modules/_pickle.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,6 @@ _Pickle_FastCall(PyObject *func, PyObject *obj)
346346
{
347347
PyObject *result;
348348

349-
/* Note: this function used to reuse the argument tuple. This used to give
350-
a slight performance boost with older pickle implementations where many
351-
unbuffered reads occurred (thus needing many function calls).
352-
353-
However, this optimization was removed because it was too complicated
354-
to get right. It abused the C API for tuples to mutate them which led
355-
to subtle reference counting and concurrency bugs. Furthermore, the
356-
introduction of protocol 4 and the prefetching optimization via peek()
357-
significantly reduced the number of function calls we do. Thus, the
358-
benefits became marginal at best. */
359-
360349
result = _PyObject_CallArg1(func, obj);
361350
Py_DECREF(obj);
362351
return result;

0 commit comments

Comments
 (0)