Skip to content

Why does repo.git.log() spend so much time? #959

Description

@Vergissmeinicht

from git import Repo
repo = Repo('my-git-repo-path')
commit_msg = repo.git.log('some-file-path')
I measure the time spent and it seems that it may take up to 0.3s to get a commit message of some file. I am wondering how the function log() is implemented and how to modify my code to make it faster.
So much thanks if someone can help!

Activity

  1. Byron commented on Nov 12, 2019

    @Byron
    Member

    I labeled this issue 'Q&A' because there is no indication this is believed to be a performance regression. Also I will close the issue, as answers are possible with on a closed issue as well.

    In the meantime, I suggest to provide much more information about your setup, namely the operating system, python and GitPython version, as well as the kind of file-system the repository is located on. Maybe it's useful to also provide numbers of the similar functionality produced by the git command-line program, both on cold and hot file-system cache.

    It might be worth for you to produce a script that reproduces the issue on any machine, and pass it through a profiler. Good luck.

  2. reopened this on Feb 26, 2021
  3. locked and limited conversation to collaborators on Feb 26, 2021
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions