git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git performance on OS X

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 19, 2008, 23:26 UTC
Message-ID
<alpine.LFD.1.10.0804191619240.2779@woody.linux-foundation.org>
In-Reply-To
<0BE9BBE3-EA9D-4A66-A086-A2A1B289B0DD@ai.rug.nl>
On Sun, 20 Apr 2008, Pieter de Bie wrote:
> 
> The number of lstats are cut down by your patch: 428761 vs. 338091. Funnily
> enough, there is no significant difference in run-time:
It may be that the problem with OS X is a sucky pathname cache mechanism.

The trivial patch cut down the number of stat() calls by a fair amount, but the calls that got removed were all of the "do two 'lstat()' calls on the exact same pathname consecutively" type.

Maybe OS X has some very limited pathname caching that catches that, or even if not, it just ends up being very nice in the D$, so it's not a big deal. And then the real suckiness happens only with bigger workloads.

It may also be that the bulk of the OS X cost isn't in lstat() at all, but in the VM. That was true for some other OS X load.

> Command                                            Mean     Std
> git status .                                       13.970  1.298
> /Users/pieter/projects/External/git/git-status .   13.759  0.321
This is the WebKit archive, right?

For me, doing a "time git status ." on the WebKit thing I just cloned from git://git.webkit.org/WebKit.git is much faster: 1.264s (and it goes down by maybe 5-10% with my lstat-avoidance patch).

Is there any system-level profiler for OS X to get a clue where that cost is, in case it's not the lstat() at all?

			Linus
Previous: Pieter de BieNext: Roman Shaposhnik
Message 30 of 39 in “Git performance on OS X”
  1. Pieter de BieApr 19, 2008
  2. Linus TorvaldsApr 19, 2008
  3. Linus TorvaldsApr 19, 2008
  4. Pieter de BieApr 19, 2008
  5. David KastrupApr 20, 2008
  6. Linus TorvaldsApr 19, 2008
  7. Pieter de BieApr 19, 2008
  8. Linus TorvaldsApr 19, 2008
  9. Junio C HamanoApr 20, 2008
  10. 01/02 implement a stat cacheLuciano Rocha, Apr 20, 2008
  11. 02/02 make use of the stat cacheLuciano Rocha, Apr 20, 2008
  12. Luciano RochaApr 20, 2008
  13. Linus TorvaldsApr 20, 2008
  14. Luciano RochaApr 20, 2008
  15. Linus TorvaldsApr 20, 2008
  16. Linus TorvaldsApr 20, 2008
  17. Dmitry PotapovApr 21, 2008
  18. Johan HerlandApr 21, 2008
  19. Junio C HamanoApr 21, 2008
  20. Linus TorvaldsApr 21, 2008
  21. Linus TorvaldsApr 21, 2008
  22. Junio C HamanoApr 21, 2008
  23. Linus TorvaldsApr 21, 2008
  24. Junio C HamanoApr 21, 2008
  25. David KastrupApr 21, 2008
  26. Jakub NarebskiApr 19, 2008
  27. Linus TorvaldsApr 19, 2008
  28. Linus TorvaldsApr 19, 2008
  29. Pieter de BieApr 19, 2008
  30. Linus TorvaldsApr 19, 2008
  31. Roman ShaposhnikApr 19, 2008
  32. Pieter de BieApr 19, 2008
  33. Linus TorvaldsApr 20, 2008
  34. Roman ShaposhnikApr 20, 2008
  35. Pieter de BieApr 19, 2008
  36. Linus TorvaldsApr 20, 2008
  37. Dmitry PotapovApr 20, 2008
  38. David KastrupApr 20, 2008
  39. Linus TorvaldsApr 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.