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

Re: git-index-pack really does suck..

From
Nicolas Pitre <nico@cam.org>
Date
Apr 3, 2007, 21:42 UTC
Message-ID
<alpine.LFD.0.98.0704031735470.28181@xanadu.home>
In-Reply-To
<Pine.LNX.4.64.0704031413200.6730@woody.linux-foundation.org>
On Tue, 3 Apr 2007, Linus Torvalds wrote:
Show 25 quoted lines
> 
> 
> On Tue, 3 Apr 2007, Nicolas Pitre wrote:
> >
> > I don't see where that might be.  The only thing that the paranoia check 
> > triggers is:
> > 
> > 	foo = read_sha1_file(blah);
> > 	memcmp(foo with bar);
> > 	free(foo);
> > 
> > So where is that commit ID information actually stored when using 
> > read_sha1_file()?
> 
> I've got the numbers: it uses much more memory when doing even failing 
> lookups, ie:
> 
> 	With --paranoid: 5583 minor pagefaults (21MB)
> 	Without --paranoid: 2957 minor pagefaults (11MB)
> 
> (remember, this was *just* the git pack, not the kernel pack)
> 
> It could be as simple as just the index file itself. That's 11MB for the 
> kernel. Imagine if the index file was 20 times bigger - 200MB of memory 
> paged in with bad access patterns just for unnecessary lookups.

Again that presumes you have to page in the whole index, which should not happen when pulling (much smaller packs) and with a better lookup algorithm.

Show 6 quoted lines
> > Not if you consider that it is performed _while_ receiving (and waiting 
> > for) the pack data over the net in the normal case.
> 
> ..which is why I think it makes sense for "pull" to be paranoid. I just 
> don't think it makes sense to be paranoid *all* the time, since it's 
> clearly expensive.

Make it conditionnal on --stdin then. This covers all cases where we really want the secure thing to happen, and the --stdin case already perform the atomic rename-and-move thing when the pack is fully indexed.

Nicolas
Previous: Linus TorvaldsNext: Junio C Hamano
Message 42 of 58 in “git-index-pack really does suck..”
  1. Linus TorvaldsApr 3, 2007
  2. Linus TorvaldsApr 3, 2007
  3. Nicolas PitreApr 3, 2007
  4. Nicolas PitreApr 3, 2007
  5. Chris LeeApr 3, 2007
  6. Nicolas PitreApr 3, 2007
  7. Chris LeeApr 3, 2007
  8. Linus TorvaldsApr 3, 2007
  9. Nicolas PitreApr 3, 2007
  10. Junio C HamanoApr 3, 2007
  11. Linus TorvaldsApr 3, 2007
  12. Nicolas PitreApr 3, 2007
  13. Chris LeeApr 3, 2007
  14. Linus TorvaldsApr 3, 2007
  15. Linus TorvaldsApr 3, 2007
  16. Shawn O. PearceApr 3, 2007
  17. Linus TorvaldsApr 3, 2007
  18. Shawn O. PearceApr 3, 2007
  19. Linus TorvaldsApr 3, 2007
  20. Linus TorvaldsApr 3, 2007
  21. Junio C HamanoApr 3, 2007
  22. Shawn O. PearceApr 3, 2007
  23. Junio C HamanoApr 3, 2007
  24. 1/2 git-fetch--tool pick-rrefJunio C Hamano, Apr 5, 2007
  25. 2/2 git-fetch: use fetch--tool pick-rref to avoid local fetch from alternateJunio C Hamano, Apr 5, 2007
  26. Shawn O. PearceApr 5, 2007
  27. Junio C HamanoApr 5, 2007
  28. Nicolas PitreApr 3, 2007
  29. Shawn O. PearceApr 3, 2007
  30. Junio C HamanoApr 3, 2007
  31. Shawn O. PearceApr 3, 2007
  32. Jeff KingApr 3, 2007
  33. Dana HowApr 3, 2007
  34. Linus TorvaldsApr 3, 2007
  35. David LangApr 3, 2007
  36. Nicolas PitreApr 3, 2007
  37. Nicolas PitreApr 3, 2007
  38. Linus TorvaldsApr 3, 2007
  39. Nicolas PitreApr 3, 2007
  40. Shawn O. PearceApr 3, 2007
  41. Linus TorvaldsApr 3, 2007
  42. Nicolas PitreApr 3, 2007
  43. Junio C HamanoApr 3, 2007
  44. Shawn O. PearceApr 3, 2007
  45. Nicolas PitreApr 3, 2007
  46. Linus TorvaldsApr 3, 2007
  47. Nicolas PitreApr 3, 2007
  48. David LangApr 3, 2007
  49. Alex RiesenApr 4, 2007
  50. David LangApr 6, 2007
  51. Junio C HamanoApr 6, 2007
  52. Junio C HamanoApr 6, 2007
  53. David LangApr 6, 2007
  54. Junio C HamanoApr 6, 2007
  55. David LangApr 6, 2007
  56. Linus TorvaldsApr 3, 2007
  57. Junio C HamanoApr 3, 2007
  58. Nicolas PitreApr 3, 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.