[issue31993] pickle.dump allocates unnecessary temporary bytes / str

Olivier Grisel report at bugs.python.org
Sun Nov 12 11:45:49 EST 2017


Olivier Grisel <olivier.grisel at ensta.org> added the comment:

Flushing the buffer at each frame commit will cause a medium-sized write every 64kB on average (instead of one big write at the end). So that might actually cause a performance regression for some users if the individual file-object writes induce significant overhead.

In practice though, latency inducing file objects like filesystem-backed ones are likely to derive from the [BufferedWriter](https://docs.python.org/3/library/io.html#io.BufferedWriter) base class and the only latency we should really care about it the one induced by the write call overhead itself in which case the 64kB frame / buffer size should be enough.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31993>
_______________________________________


More information about the Python-bugs-list mailing list