-
-
Notifications
You must be signed in to change notification settings - Fork 954
Why does repo.git.log() spend so much time? #1138
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
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
-
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.
Beta Was this translation helpful? Give feedback.