-
Notifications
You must be signed in to change notification settings - Fork 815
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
git diff unusually slow #2837
Labels
Comments
@therealkenc Sorry, I searched but couldn't find them. Thanks for reporting the original issue, I'll make sure to follow #981. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Windows build number: (Type
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.16299.125]
What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
git diff
What's wrong / what should be happening instead:
The command takes ~450 ms to execute / The execution should be nearly instantaneous
Strace of the failing command, if applicable: (If
some_command
is failing, then runstrace -o some_command.strace -f some_command some_args
, and link the contents ofsome_command.strace
in a gist here)N/A
When working on Ubuntu, I use a fairly complex command prompt that detects if my working directory is part of a
git
repository. If so, the prompt also adds information about the current branch and its status.I noticed that there was an unusual latency (~1 second) between the end of a command and the display of the prompt, so I
set -x
to identify the bottleneck and realized that half of the time was spent runninggit diff
, which I then confirmed by running the command withtime
(which consistently reports ~450 milliseconds).If this can be useful, I'm currently running the Docker for Windows (version 17.12.0-ce-win45 (15017), channel edge, build 6bbf198) using the experimental option "Linux containers on Windows" and by running the same
git diff
on the same repository inside adocker
container based on theubuntu
image, the times are slightly better (around ~350 milliseconds).Furthermore, running
git diff
on thebash
that is installed as part of Git for Windows yields even better times (~200 milliseconds).On a virtual machine provisioned on OpenStack with comparable resources but running Ubuntu natively, the execution of
git diff
on the same repository is nearly instantaneous (~1 millisecond).I can imagine this is due to the many levels of indirections that are involved in the whole WSL, but I was wondering if there's something in particular that causes this slowdown.
The text was updated successfully, but these errors were encountered: