Re:
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- May 8, 2009, 15:51 UTC
- Message-ID
- <eFUCK0_CEtLa6Qvg6X1SqHmCgRnY3_3dy3OCJK26lGP-_kDRyWtlRA@cipher.nrlssc.navy.mil>
- In-Reply-To
- <alpine.LFD.2.01.0905080734260.4983@localhost.localdomain>
Linus Torvalds wrote:
Show 17 quoted lines
> > On Fri, 8 May 2009, Alex Riesen wrote: >> I did (cygwin). My guess, the improvement is completely dwarfed by the >> other overheads (like starting git and writing files). > > Oh, I meant "git checkout" as in not even switching branches, or perhaps > switching branches but just changing a single file (among thousands). > > If you actually end up re-writing all files, then yes, it will obviously > be totally dominated by other things. > > For example, in the kernel, switching between two branches that only > differ in one file (Makefile) went from 0.18 seconds down to 0.14 seconds > for me just because of the fewer lstat() calls. > > Noticeable? No. But it might be more noticeable on some other OS, or with > some networked filesystem.
plain 'git checkout' on linux kernel over NFS.
Best time without patch: 1.20 seconds
0.45user 0.71system 0:01.20elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+15467minor)pagefaults 0swaps
Best time with patch (core.preloadindex = true): 1.10 seconds
0.43user 4.00system 0:01.10elapsed 402%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+13999minor)pagefaults 0swaps
Best time with patch (core.preloadindex = false): 0.84 seconds
0.42user 0.39system 0:00.84elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+13965minor)pagefaults 0swaps
Best time with read_cache_preload patch only: 1.38 seconds
0.45user 4.42system 0:01.38elapsed 352%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+13990minor)pagefaults 0swaps
The read_cache_preload() changes actually slow things down for me for this case.
Reduction in lstat's gives a nice 30% improvement.
-brandon