-
Notifications
You must be signed in to change notification settings - Fork 340
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
Prompt slows down noticeably #9
Comments
Hey, the use of |
Would you mind running |
|
That's even worse than Have you garbage collected/optimized the repo with |
I've just pushed some changes which switches As for your repo, I'm hoping running |
Any news about the performance after running |
You can add the --ignore-submodules, it decreased a time for 30% in my case. But obviously you will not see if they were changed. |
In my experience git's store was not the bottleneck (git is so damn efficient!), but the storage device causes the slowdown, because git has to check through every folder in the project to see if there are any new or changed files for the dirty marker. This is most noticeable when first entering a project folder with My fork addresses this by aborting after a fixed timeout, so a prompt can be displayed without any stats, and leaves The disadvantages with my approach is that your neat code becomes rather gnarly, and running and checking background processes adds a small overhead on every call. Also I cannot set the timeout too low, because even with data in the disk cache, (I am also unsure if this really addresses the OP's issue: he is worried about 50ms, whereas I am more worried about 5 seconds!) Anyway thanks for the tool jimeh, it has made working with git much more relaxing for me! |
btw, i ended up alleviating this for myself by just removing the dirty checking portion of the prompt. that is, replace
with
since then i've been a loyal user :) |
I'm gonna try to find some time to see if I can improve performance. Anyone know of any open source project I can clone that's causing these kinds of slow downs? And @joeytwiddle, I like the idea of a timeout, I'll have a look at your fork :) |
For testing, this project has a lot of files: https://github.com/torvalds/linux But I only really experience the issue when first moving into a large repo. Once Therefore you might want to clear your disk caches before each test, to make the slowdown reliably reproducable. |
+1 getting this issue too, repo has about 2000 files, only happens when first navigating to directory |
Maybe #52 helps to solve this problem? Works for me, but haven't tested every possible case. But I'm confident that usage of "git status" should be possible to avoid. |
I ran into this issue as well. The solution for me was to switch to git-prompt.sh. This is what I end up doing to my .bashrc source /usr/local/etc/bash_completion.d/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS=true
export PS1="${debian_chroot:+($debian_chroot)}\[\033[0;32m\]\T\[\033[00m\]:\[\033[0;35m\]\w\[\033[0;36m\]\$(__git_ps1) \[\033[00m\]\$ " It loads within ms
|
First of all thank you for this sweet tool. However, I'm having a problem where when using Git aware prompt my command prompt slows down noticeably. As in, when I press enter with no command entered it doesn't instantly show a new $ prompt. Something to note is that my repository is huge, so that might affect things. I believe the issue is with
git diff-files --quiet 2>&1
. Here's some timing information:As you can see, 0.05s is unacceptable. But this is probably because my repo is huge:
Also, I'm on Mac OSX 10.8.2.
Anyway, if you can think of a workaround that would be awesome, since I'd love to have this prompt.
The text was updated successfully, but these errors were encountered: