# Bug report ### Bug description: There is room for improvement in tarfile write performance. In a simple benchmark I find that tarfile spends most of its time doing repeated user name/group name queries. https://gist.github.com/jforberg/86af759c796199740c31547ae828aef2 ### CPython versions tested on: CPython main branch ### Operating systems tested on: Linux <!-- gh-linked-prs --> ### Linked PRs * gh-121269 <!-- /gh-linked-prs -->
Activity
pythongh-121267: Improve performance of tarfile (python#121267)
pythongh-121267: Improve performance of tarfile (python#121267)
gaogaotiantian commentedon Jul 2, 2024
Could you paste your cProfile output? I was a bit surprised that most of the time is spent on reading the pwd and grp.
jforberg commentedon Jul 2, 2024
@gaogaotiantian Here is the output:
cprofile.txt
pythongh-121267: Improve performance of tarfile (python#121267)
pythongh-121267: Improve performance of tarfile (python#121267)
gh-121267: Improve performance of tarfile (#121267) (#121269)
picnixz commentedon Oct 30, 2024
Recategorizing this issue as per #121269 (comment).
pythongh-121267: Improve performance of tarfile (python#121267) (pyth…
pythongh-121267: Improve performance of tarfile (python#121267) (pyth…