Skip to content

Tarfile is unnecessarily slow #121267

Closed
Closed

Description

@jforberg

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

Linked PRs

Activity

  1. added 2 commits that reference this issue on Jul 2, 2024
  2. gaogaotiantian commented on Jul 2, 2024

    @gaogaotiantian
    Member

    Could you paste your cProfile output? I was a bit surprised that most of the time is spent on reading the pwd and grp.

  3. jforberg commented on Jul 2, 2024

    @jforberg
    ContributorAuthor

    @gaogaotiantian Here is the output:

    cprofile.txt

  4. added 2 commits that reference this issue on Jul 3, 2024
  5. added a commit that references this issue on Oct 30, 2024
  6. added
    type-featureA feature request or enhancement
    performancePerformance or resource usage
    stdlibStandard Library Python modules in the Lib/ directory
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Oct 30, 2024
  7. picnixz commented on Oct 30, 2024

    @picnixz
    Member

    Recategorizing this issue as per #121269 (comment).

  8. added a commit that references this issue on Dec 8, 2024
  9. added a commit that references this issue on Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions