-
Notifications
You must be signed in to change notification settings - Fork 7
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
Long delay with brws'ing a file in a large repository #19
Comments
Thank you for reporting this. I think this is because underlying some |
It's a private work repository, but I will also check this on something larger and see what I can uncover. If push comes to shove I'll probably dig into https://github.com/tpope/vim-rhubarb just to see how tpope went about it, and then can learn how you went about it Will report back |
Okay, testing on https://github.com/llvm/llvm-project was a good idea:
Curious what your experience will be. And for the record, tpope pretty much cheats making his technique "instant" in all cases, by taking the remote url and converting it into the Github url. He has that liberty because his plugin only cares about Github, but I suppose it seems like a harmless way to go about it in your
|
I tried llvm-mirror/llvm on my machine (iMac 2013 Late) but it only took 0.063s.
Thank you for digging into. Would you try below commands and check if this issue occurs or not?
As you kindly investigated, getting remote URL might be the cause. There are two functions to get remote URL in
If |
Hm, well certainly it is much quicker for you than me! I'm running from an X1 Carbon from ~2017 Trying Otherwise, it is:
|
I listed git commands invoked while running time git config --get remote.origin.url
time git rev-parse --abbrev-ref --symbolic '@{u}'
time git rev-parse --abbrev-ref --symbolic HEAD
time git rev-parse --absolute-git-dir
time git rev-parse HEAD |
Well this is something!
Oh right, I should probably point these at a specific file though! |
Here's pointing at a file.. same thing, hm:
|
Thank you for your help. Ah, I missed one more command which is executed by $ hash=$(git rev-parse HEAD)
$ time git branch --remote --contains $hash This might be slow when your private repository has so many remote branches since it checks specified hash is included in some remote branch. LLVM repository would not be slow because it has only 32 remote branches. This check is necessary to check if the hash is already pushed to remote. If it is not pushed to remote yet, opening the URL will run into 404. In the case |
OK, I finally could reproduce this issue. I've remembered that Kotlin repository has so many 2821 branches. https://github.com/JetBrains/kotlin I cloned it and tried to reproduce this issue: $ cd /path/to/kotlin
$ time git brws ReadMe.md
git brws ReadMe.md 5.51s user 0.17s system 96% cpu 5.871 total It took 5.871 seconds. I also confirmed $ time git branch --remote --contains $(git rev-parse HEAD)
origin/HEAD -> origin/master
origin/master
origin/rr/mg/kotlin-jps-without-java-clean
git branch --remote --contains $(git rev-parse HEAD) 5.47s user 0.22s system 91% cpu 6.230 total |
I will try to fix this issue. |
This issue was fixed at a341398 as follows: $ cd /path/to/kotlin
$ time git-brws ReadMe.md
git-brws ReadMe.md 0.04s user 0.05s system 63% cpu 0.154 total |
The fix was included in 0.11.5. |
Howdy, just did a cargo build of the tool to test out simply browsing a file in the browser on its relevant branch, in Github.
I'm seeing times such as:
And of course I tested this on a much smaller repo, and it is "instant"
I'm curious what the underlying mechanism is for I suppose finding which URL to open, and what could be a bottleneck within it regarding large repos?
I'm mostly interested in this tool for this single behavior, as it allows me to remove a vim plugin thats sole purpose is also this behavior, and I use it a lot in aforementioned repo
Thanks :)
The text was updated successfully, but these errors were encountered: