cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-121109: Fix performance of tarfile reading with "r|*"

Open TomiBelan opened this issue 1 year ago • 1 comments

This PR fixes #121109.

Using the test files and test script described in the issue:

filename mode time with PR
test.tar.gz r:* 1.075s
test.tar.gz r|* 0.812s
test.tar.xz r:* 1.066s
test.tar.xz r|* 1.053s
test.tar.bz2 r:* 0.913s
test.tar.bz2 r|* 0.896s

After this PR, tf.list() of r|* is the same speed as r:*, as expected. Not orders of magnitude slower.

  • Issue: gh-121109

TomiBelan avatar Jul 02 '24 20:07 TomiBelan

All commit authors signed the Contributor License Agreement.
CLA signed

ghost avatar Jul 02 '24 20:07 ghost