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

Re: Some git performance measurements..

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 29, 2007, 05:17 UTC
Message-ID
<7vr6i9y6ju.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.0.9999.0711281747450.8458@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> Less than a hundredth of a second may not sound much, but when we have 
> 1700+ directories in the kernel trees, doing that for each possible 
> .gitignore file is really really expensive!

The only thing that wants to use excluded() in the unpack_trees() codepath is the code to allow overwriting an existing, untracked file in verify_absent(). When we find an untracked file at the same path as we are just trying to check out a file, we allow overwriting it only if that file is "ignored".

But the way the unpack_trees_rec() and the gitignore handling in dir.c are structured currently means we do push/pop exclude-per-directory stack as we enter and leave a new subdirectory. We do not do this lazily on demand.

The newer gitattributes subsystem maintains a similar per-directory data structure but this is purely done on-demand; until somebody asks "what are the attrs for this path", we do not read .gitattributes file. We should be able to restructure exclude-per-directory code in a similar way.

Previous: Linus TorvaldsNext: Junio C Hamano
Message 27 of 28 in “Some git performance measurements..”
  1. Linus TorvaldsNov 29, 2007
  2. Linus TorvaldsNov 29, 2007
  3. Nicolas PitreNov 29, 2007
  4. Linus TorvaldsNov 29, 2007
  5. Nicolas PitreNov 29, 2007
  6. Linus TorvaldsNov 29, 2007
  7. Nicolas PitreNov 29, 2007
  8. Junio C HamanoNov 30, 2007
  9. Linus TorvaldsNov 30, 2007
  10. Jakub NarebskiNov 30, 2007
  11. Linus TorvaldsNov 30, 2007
  12. Jakub NarebskiNov 30, 2007
  13. Nicolas PitreNov 30, 2007
  14. Steffen ProhaskaNov 30, 2007
  15. Mike RalphsonDec 7, 2007
  16. Johannes SchindelinDec 7, 2007
  17. Linus TorvaldsDec 7, 2007
  18. Mike RalphsonDec 7, 2007
  19. Johannes SchindelinDec 7, 2007
  20. Mike RalphsonDec 7, 2007
  21. Johannes SchindelinDec 8, 2007
  22. Brian DowningDec 8, 2007
  23. Linus TorvaldsNov 30, 2007
  24. Federico Mena QuinteroDec 5, 2007
  25. Joachim B HagaDec 1, 2007
  26. Linus TorvaldsDec 1, 2007
  27. Junio C HamanoNov 29, 2007
  28. per-directory-exclude: lazily read .gitignore filesJunio C Hamano, Nov 29, 2007

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.