From: Matthieu Moy Date: Mon, 03 Sep 2007 08:19:22 GMT Subject: Re: Stats in Git Message-ID: In-Reply-To: <46DACD93.9000509@trolltech.com> Marius Storm-Olsen writes: > However, while look at that whole stat'ing situation in git, I saw > that doing 'git status' actually stats all the files _thrice_! > Yup, that's not 1 time, or 2 times, but actually 3(!) times before > 'git status' is content! My experiments show 2 stats only: $ strace -f git status |& grep -e execve -e foo [...] [pid 22492] execve("/home/moy/local/usr//bin/git", ["git", "update-index", "-q", "--unmerged", "--refresh"], [/* 50 vars */]) = 0 [pid 22492] lstat64("foo", {st_mode=S_IFREG|0755, st_size=0, ...}) = 0 [pid 22493] execve("/home/moy/local/usr//bin/git", ["git", "runstatus"], [/* 49 vars */]) = 0 [pid 22493] lstat64("foo", {st_mode=S_IFREG|0755, st_size=0, ...}) = 0 [...] Once for "git update-index --refresh" and once more for "git runstatus". Obviously, a builtin with one tree traversal only would provide a good speedup. -- Matthieu