diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-28 14:56:09 -0800 |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-11-28 14:56:09 -0800 |
commit | b13e6bcbd851c61af22c44dbe6f156653f54baae (patch) | |
tree | 62351f7cb4505e03b848b9d6abd4f0d2112b6407 /Lib/asyncio/protocols.py | |
parent | b6e66ebdf76c56b4a893c0687f91d1e6dd9cac2d (diff) | |
download | cpython-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