summaryrefslogtreecommitdiff
path: root/Lib/asyncio/protocols.py
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2013-11-28 14:56:09 -0800
committerAlexandre Vassalotti <alexandre@peadrop.com>2013-11-28 14:56:09 -0800
commitb13e6bcbd851c61af22c44dbe6f156653f54baae (patch)
tree62351f7cb4505e03b848b9d6abd4f0d2112b6407 /Lib/asyncio/protocols.py
parentb6e66ebdf76c56b4a893c0687f91d1e6dd9cac2d (diff)
downloadcpython-git-b13e6bcbd851c61af22c44dbe6f156653f54baae.tar.gz
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.
Diffstat (limited to 'Lib/asyncio/protocols.py')
0 files changed, 0 insertions, 0 deletions