OK, I have done some testing/profiling with oprofile(1), and one thing
I found out was that my Linux kernel was built with SLUB debug, and of
course it cost some system time to run the VM debug code. After I
turned this off, the total system time when down from aprox 6 to 3
seconds for the 'git checkout -q my-v2.6.25/7' test.
Also, from strace output each lstat() call now take around 16
microseconds, and each fstat() call around 12 microseconds, so for
aprox 14000 changed calls (lstat() => fstat()) the performance gain
should now only be (* 14000 (- 16 12)) = 56 ms, compared to 467 ms,
which I reported before.
-- kjetil
1) http://oprofile.sourceforge.net/about/