]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-34043: Optimize tarfile uncompress performance (GH-8089)
authorINADA Naoki <methane@users.noreply.github.com>
Fri, 6 Jul 2018 05:06:00 +0000 (14:06 +0900)
committerGitHub <noreply@github.com>
Fri, 6 Jul 2018 05:06:00 +0000 (14:06 +0900)
commit8d130913cb9359c01de412178f9942419e921170
treef144f1eead7e16809b69813e05b008fd7a8598c1
parentf12028809b0e37ee003d06e7fce8dc6a6f447a94
bpo-34043: Optimize tarfile uncompress performance (GH-8089)

tarfile._Stream has two buffer for compressed and uncompressed data.
Those buffers are not aligned so unnecessary bytes slicing happens
for every reading chunks.

This commit bypass compressed buffering.

In this benchmark [1], user time become 250ms from 300ms.

[1]: https://bugs.python.org/msg320763
Lib/tarfile.py
Misc/NEWS.d/next/Library/2018-07-04-21-14-35.bpo-34043.0YJNq9.rst [new file with mode: 0644]