Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Answered by Byron
Vergissmeinicht asked this question in Q&A
Discussion options

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!

You must be logged in to vote

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.

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #959 on February 26, 2021 11:18.

AltStyle によって変換されたページ (->オリジナル) /