Skip to content

blame (sometimes) slow #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
extrawurst opened this issue Apr 26, 2021 · 7 comments
Closed

blame (sometimes) slow #673

extrawurst opened this issue Apr 26, 2021 · 7 comments

Comments

@extrawurst
Copy link
Collaborator

@cruessler I use the linux repo as a worst case git repo often to benchmark. doing a blame on include/uapi/linux/netfilter/xt_MARK.h takes incredibly long. we should look into this. (hope its not the underlying libgit2 to blame):

gitui.log:

13:16:08 [TRACE] (2) scopetime: [scopetime/src/lib.rs:41] scopetime: 197212 ms [asyncgit::sync::blame::blame_file] @asyncgit/sr
c/sync/blame.rs:57

git cli blame:

time git blame include/uapi/linux/netfilter/xt_MARK.h
Blaming lines: 100% (16/16), done.

git blame include/uapi/linux/netfilter/xt_MARK.h  2.97s user 0.68s system 25% cpu 14.048 total
@cruessler
Copy link
Collaborator

I just had a look at the issue (also using the linux repo). On my machine, repo.blame_file seems to be responsible for the wait. As far as I could see, no other call even came close to having an influence.

@extrawurst
Copy link
Collaborator Author

extrawurst commented Apr 26, 2021

Seems a known issue: libgit2/libgit2#3027
😣

@cruessler
Copy link
Collaborator

One solution I found would be to shell out to git and parse the output: Arrowbox/git-whoknows@70ca833. But that would mean having git installed as a dependency.

@extrawurst
Copy link
Collaborator Author

One solution I found would be to shell out to git

that is not an option. we made it this far without that :)
I'd rather checkout optimising the blame algorithm inside libgit2

@muman613
Copy link

Just started using libgit2 with the hopes of using it to automate extracting blame info from git repos. Found it it takes a VERY LONG time to run a blame using libgit2 compared to running git blame. I was hoping to find a way to speed it up... Looks like Im not the only one.

@muman613
Copy link

For the record, I just observed a release build (from source) example lg2 blame take 3 minutes and 12 seconds to extract the blame report compared to the git blame report which is generated in .094 seconds....

Seriously that is dismal performance. Not that it is anyones fault, but I cannot use this in a real world situation with such a delay to just extract the blame information. I will be dealing with 100s of files which will need to extract blame info for lines in the source. At this rate it will take weeks to just generate the report.

Thank you. And if there is a good solution I will certain listen, and if there is a patch I can try, I'll try it.

@extrawurst
Copy link
Collaborator Author

This has to be fixed upstream in libgit2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants