git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Soem core git optimizations
@ 2008-05-09 16:04 Linus Torvalds
  2008-05-09 16:11 ` [PATCH 1/2] Avoid some unnecessary lstat() calls Linus Torvalds
  2008-05-11  2:36 ` [PATCH 0/2] Soem core git optimizations Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Linus Torvalds @ 2008-05-09 16:04 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


I notice that Junio merged my fnmatch-avoidance patch, but I have a few 
other optimizations that I track in my private tree that I have sent out 
but probably didn't get much attention. They do matter from a performance 
angle, even if not as much as avoiding fnmatch did.

The first patch is obvious and pretty trivial: just moving lstat() calls 
up a bit in the call-chain, so that you don't end up unnecessarily doing 
two lstat() calls after each other.

The second patch is the symlink detection rewrite, which avoids a _lot_ of 
unnecessary lstat calls under some loads by not doing the lstat on the 
directory path entries over and over for each pathname. It's just a 
single-deep cache for "last directory seen" and "last symlink seen", and 
replaces the old code that only cached the last symlink.

Diffstat for the combined thing as follows:

 builtin-apply.c  |    2 +-
 builtin-commit.c |    6 ++-
 cache.h          |    4 ++-
 diff-lib.c       |   10 +++---
 read-cache.c     |   29 +++++++++++--------
 symlinks.c       |   82 ++++++++++++++++++++++++++++++++---------------------
 unpack-trees.c   |   12 +++----
 7 files changed, 84 insertions(+), 61 deletions(-)

and while this probably doesn't matter on most loads, the reason I'm 
re-sending is that I think it's pretty solid and core code. I've been 
running with both of these patches (and some others) rebased on top of 
Junio's tree for the last few weeks.

		Linus

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

end of thread, other threads:[~2008-05-11  2:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09 16:04 [PATCH 0/2] Soem core git optimizations Linus Torvalds
2008-05-09 16:11 ` [PATCH 1/2] Avoid some unnecessary lstat() calls Linus Torvalds
2008-05-09 16:21   ` [PATCH 2/2] Optimize symlink/directory detection Linus Torvalds
2008-05-11  2:36 ` [PATCH 0/2] Soem core git optimizations Junio C Hamano
2008-05-11  2:42   ` Linus Torvalds

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).