git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Slow git add . performance in large repo
@ 2025-03-17 18:53 Yissachar Radcliffe
  2025-03-17 23:00 ` brian m. carlson
  0 siblings, 1 reply; 4+ messages in thread
From: Yissachar Radcliffe @ 2025-03-17 18:53 UTC (permalink / raw)
  To: git

We have a relatively large git repo and have noticed that `git add .`
operations are slow (~1.5-2s). We have core.fsmonitor and
core.untrackedCache set to true and `git status` executes in ~300ms.
When I turn on trace2 I can see that almost all the time is spent in
read_directo and it's visiting 26960 directories and 77989 paths.

I can use `git add <foo>` or `git add -u .` to speed things up but
`git add .` is the most convenient for us. I created a small script to
pipe the results of `git status` to `git add` and that runs in <500ms.
This leaves me confused as to why the built-in performance is so slow.

git version is 2.49.0, mac os x 15.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-18 21:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 18:53 Slow git add . performance in large repo Yissachar Radcliffe
2025-03-17 23:00 ` brian m. carlson
2025-03-18  2:04   ` Yissachar Radcliffe
2025-03-18 21:06     ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).