git commit results in many lstat()s
- From
Gumbel, Matthew K <matthew.k.gumbel@intel.com>
- Date
- Feb 1, 2017, 21:45 UTC
- Message-ID
- <DA0A42D68346B1469147552440A645039A9C56D4@ORSMSX115.amr.corp.intel.com>
Hello,
My high level problem is to speed up git commit on a large repository stored on NFS filesystem. I see via strace that it is slow because it makes a large number (~50,000) of lstat() calls in serial. Every call is a round-trip to the NFS server.
I do not understand why git commit must call lstat() on every file in the repository, even when I specify the name of the file I want to commit on the command line. Can somebody explain why it must call lstat on every file?
My command-line looks like this: git commit -uno -o -m asdf file-to-commit.txt
Secondly, are there any optimizations I can make to avoid this behavior?
Thanks, Matt