Repository navigation
Closed
Description
It seem to me every time I commit a normal files (text file) with small change took more than 40seconds to be finished.
When I look at the TRACE, it seem to be delay for a while at 11:42:05.182320 trace git-lfs: exec: git 'version'.
Also, run git lfs install is really slow too. Wounder they are relate.
I Also noted that git lfs env took a quite a long time to complete too.
See all the log bellow:
git commit -a -m ".................."
11:42:04.475541 git.c:344 trace: built-in: git commit -a -m '...........'
11:42:04.842330 run-command.c:640 trace: run_command: git gc --auto
11:42:04.920327 git.c:344 trace: built-in: git gc --auto
11:42:04.935927 run-command.c:640 trace: run_command: GIT_EDITOR=: GIT_INDEX_FILE=/cygdrive/c/projects/git/XYZ/.git/modules/XX/YY/index /cygdrive/c/projects/git/XYZ/.git/modules/XX/YY/hooks/post-commit
11:42:05.091922 git.c:576 trace: exec: git-lfs post-commit
11:42:05.091922 run-command.c:640 trace: run_command: git-lfs post-commit
11:42:05.182320 trace git-lfs: exec: git 'version'
11:43:23.773230 trace git-lfs: exec: git 'config' '-l'
11:43:34.398492 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
11:43:47.358082 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
11:43:47.358082 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
11:43:47.358082 trace git-lfs: filepathfilter: rejecting "YY" via []
11:43:47.358082 trace git-lfs: filepathfilter: accepting "YY"
11:43:47.358082 trace git-lfs: filepathfilter: rewrite "~*.*" as "**/~*.*"
....
(519)$ git-lfs version
git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
(519)$ git version
11:52:17.642972 git.c:344 trace: built-in: git version
git version 2.17.0
(521)$ git-lfs env
11:55:22.963372 trace git-lfs: exec: git 'version'
git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
git version 2.17.0
11:55:35.774772 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
11:56:54.454613 trace git-lfs: exec: git 'config' '-l'
Endpoint=https://stash.ZZZZ.com/att/YY.git/info/lfs (auth=basic)
[email protected]:att/YY.git
LocalWorkingDir=C:\projects\git\XYZ\XX\YY
LocalGitDir=C:\projects\git\XYZ\.git\modules\XX\YY
LocalGitStorageDir=C:\projects\git\XYZ\.git\modules\XX\YY
LocalMediaDir=C:\projects\git\XYZ\.git\modules\XX\YY\lfs\objects
LocalReferenceDirs=
TempDir=C:\projects\git\XYZ\.git\modules\XX\YY\lfs\tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\projects\git\XYZ\.git\modules\XX\YY\lfs
AccessDownload=basic
AccessUpload=basic
DownloadTransfers=basic
UploadTransfers=basic
GIT_CURL_VERBOSE=1
GIT_LFS_PATH=C:\Program Files\Git LFS
GIT_TRACE=1
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
11:56:58.899219 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
11:56:58.899219 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
11:56:58.899219 trace git-lfs: filepathfilter: rejecting "tmp" via []
11:56:58.899219 trace git-lfs: filepathfilter: accepting "tmp"
11:56:58.899219 trace git-lfs: filepathfilter: rejecting "objects" via []
11:56:58.899219 trace git-lfs: filepathfilter: accepting "objects"
Metadata
Metadata
Assignees
Labels
No labels
Activity
bk2204 commentedon Jan 23, 2019
Hey, sorry to hear you're having trouble.
It looks like for some reason one of two things is happening:
gitis for some reason very expensive.I'm not seeing this on my system.
@nhatkhai, can you try running each of those commands on the command line, prefixed with
time, and put the output here? I'd like to see if that's the cause of the issue.Also, it looks like you're using Cygwin. Are you using Cygwin's Git, or Git for Windows? And are you using Git LFS from Git for Windows, or specifically built for Cygwin?
@ttaylorr, do you happen to know why we use a single lock for all of these cases? I'm wondering if it might perform better if we used independent
sync.Oncevalues here (stuffing them into a struct for tidiness).nhatkhai commentedon Jan 23, 2019
@bk2204, I'm using Cygwin git, and git-lfs for windows. Which command line you want me to run with time? I think the trace have all the time stamp which is very clear to see. I'm not sure time prefix would show any more useful info.
I try ran in with Git for windows, and git-lfs for windows. It much much better:
ttaylorr commentedon Jan 23, 2019
Could you clarify which locks you're talking about? It looks like the slowdown is happening from some call in
git lfs post-commit, but I was only able to spot out the 'git version' call immediately.I was able to implement the replacement that you're talking about (I think, see #3492), but if there are other places that you are thinking about, too, I'd be happy to look there too.
nhatkhai commentedon Jan 24, 2019
Yes it was slow down at 11:42:05.182320 to 11:43:47.358082.
And 11:55:22.963372 to 11:56:54.454613
And here it also slow similar way for git-lfs install (from 18:57:51.630246 to 19:00:09.058246):
My Global .gitconfig file look like:
My project .git/config file look like:
nhatkhai commentedon Jan 24, 2019
Is there a git-lfs image build for cygwin?
Not all the project I used are slow, most only once that have lfs files. It wasn't this slow before, but may be after I introduce submodule which also have lfs files.
bk2204 commentedon Jan 24, 2019
Of course. I was thinking about the
loadingmutex. My conjecture was that we were in some way contending on that mutex, since we see a slowdown between each pair ofgit version,git rev-parse, andgit config.bk2204 commentedon Jan 24, 2019
The reason I asked to run with the
timecommand is because I want to see if this is an issue with Git LFS (i.e., that it has a bad interaction with Cygwin) or if the issue is that Git itself is for some reason slow on Cygwin. If running the Git commands themselves is slow, then that's a separate issue.I'd want the
timecommand to be run in the environment in which you're running your code. So if that's Cygwin, then Cygwin is the place to run the commands.I'm not aware of any native builds for Cygwin, since Go doesn't have that as a target architecture. There was some discussion of it, but it doesn't seem to have gotten off the ground.
nhatkhai commentedon Jan 24, 2019
bk2204 commentedon Jan 24, 2019
I'm sorry, I think I was unclear. The
timeoutput I was looking for was for the git commands that appear in the trace output, namely the following:I want to find out if
git versionandgit config -lthat are slow or if it's Git LFS's handling of their output.nhatkhai commentedon Jan 24, 2019
ttaylorr commentedon Jan 26, 2019
Thanks for the clarification. I looked into whether or not this was doable in
config/config.go, and I think that our current use ofsync.Mutexis (in the general sense) appropriate. We use theloadingmutex for one of two things:sync.Once), or,The Git configuration values themselves are handled differently. For these, we use 2 implementations of the
config.Environmentinterface:gitEnvironmentanddelayedEnvironment. Upon construction, agitEnvironmentreads all of the values in the repository's configuration, and builds a correspondingmap[string]string. To avoid doing this until the last possible moment, we use adelayedEnvironment, which delays construction until the first time a query is issued.So I don't think that there is a ton of work for us to do that would meaningfully improve the performance issues that we're seeing here. Is it possible that these are coming as a result of some interaction between Git LFS and Cygwin? If so, I don't know that there's much that we can do in general, except pass this bug report over to someone who works on Cygwin.
@bk2204 @nhatkhai what are your thoughts?
nhatkhai commentedon Feb 14, 2019
Are there better way to narrow down more to see why parsing .gitconfig files way too slow in Cygwin?
git-lfs install run way so long under Cygwin (1min 26 seconds!!!). I don't see this trouble with git only when it parsing it own .gitconfig files!
bk2204 commentedon Feb 15, 2019
My guess about why the delay is so great is something having to do with an interaction between native Windows programs like Git LFS and Cygwin programs, such as a problem with the pipes or handles being used. Unfortunately, I don't know very much about Cygwin or Windows, so I can't be of much help here. Go doesn't build programs for Cygwin (mostly because the language doesn't use libc), so it isn't possible to build a native version of Git LFS for Cygwin.
If you're using Windows 10, it may be possible for you to try Windows Subsystem for Linux, which should have better performance in this area.
I'm sorry I can't be of more help.
[-]git commit take unexpected long time[/-][+]git commit take unexpected long time for Cygwin[/+]nhatkhai commentedon Aug 19, 2019
Look like with git lfs 2.7.1 is work faster now: