diff Python/sysmodule.c @ 87630:dd51b72cfb52

Remove the tuple reuse optimization in _Pickle_FastCall. I have noticed a race-condition occurring on one of the buildbots because of this optimization. The function called may release the GIL which means multiple threads may end up accessing the shared tuple. I could fix it up by storing the tuple to the Pickler and Unipickler object again, but honestly it really not worth the trouble. I ran many benchmarks and the only time the optimization helps is when using a fin-memory file, like io.BytesIO on which reads are super cheap, combined with pickle protocol less than 4. Even in this contrived case, the speedup is a about 5%. For everything else, this optimization does not provide any noticable improvements.
author Alexandre Vassalotti <alexandre@peadrop.com>
date Thu, 28 Nov 2013 14:56:09 -0800
parents adb471b9cba1
children
line wrap: on
line diff