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

Re: [RFC PATCH] index-pack: Issue a warning if deltaBaseCacheLimit is too small

From
Nicolas Pitre <nico@cam.org>
Date
Jul 17, 2008, 23:45 UTC
Message-ID
<alpine.LFD.1.10.0807171914270.3213@xanadu.home>
In-Reply-To
<20080717220251.GA3072@spearce.org>
On Thu, 17 Jul 2008, Shawn O. Pearce wrote:
Show 11 quoted lines
> Its rare that we should exceed deltaBaseCacheLimit while resolving
> delta compressed objects.  By default this limit is 16M, and most
> chains are under 50 objects in length.  This affords about 327K per
> object in the chain, which is quite large by source code standards.
> 
> If we have to recreate a prior delta base because we evicted it to
> stay within the deltaBaseCacheLimit we can warn the user that their
> configured limit is perhaps too low for this repository data set.
> If the user keeps seeing the warning they can research it in the
> documentation, and consider setting it higher on this repository,
> or just globally on their system.

As I said earlier, I don't think this is a good idea, but I'll elaborate a bit more.

First, this is a really bad clue for setting deltaBaseCacheLimit. The likelyhood of this warning to actually show up during an initial clone is relatively high, yet this doesn't mean that deltaBaseCacheLimit has to be changed at all. For one, the real time usage of deltaBaseCacheLimit is to cap a cache of objects for multiple delta chains with random access, and not only one chain traversed linearly like in the index-pack case, and that cache is likely to always be full and in active eviction mode -- that's the point of a cap after all. In the index-pack this is only used to avoid excessive memory usage for intermediate delta results and not really a cache. In other words, we have two rather different usages for the same settings. Now don't read me wrong: I think that reusing this setting is sensible, but its value should not be determined by what index-pack may happen to do with it, especially on a first clone. And issuing warnings on the first clone is not the way to give new users confidence either.

Secondly, on subsequent fetches, the warning is likely to never appear again due to the fact that the delta chains will typically be much shorter. And that would be true even if in reality the runtime access to the repository would benefit a lot from deltaBaseCacheLimit being raised. And it is the runtime access which is important here, not the occasional fetch. Yet the full delta chains are not likely to be walked in their entirety very often anyway either.

Thirdly, if such indication is considered useful, then it should really be part of some statistic/analysis tool, such as verify-pack for example. Such a tool could compute the exact memory requirements for a given repository usage and possibly provide suggestions as to what the optimal deltaBaseCacheLimit value could be. But yet that cache has a hardcoded number of entries at the moment and its hash function might not be optimal either, making the connection with index-pack even more apart.

And finally, I think that index-pack would benefit a lot from a really simple optimization which is to free the resulting intermediate delta base object right away when there is only one delta child to resolve, before that child is itself used as a base for further delta grand-children. That is likely to cover most cases of big delta chains already, making that warning an even worse indicator.

> Suggested-by: Stephan Hennig <mailing_list@arcor.de>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Unrecommended-by: Nicolas Pitre <nico@cam.org>
Nicolas
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 48 of 51 in “git pull is slow”
  1. Stephan HennigJul 10, 2008
  2. Martin LanghoffJul 10, 2008
  3. Petr BaudisJul 10, 2008
  4. Johannes SixtJul 10, 2008
  5. Stephan HennigJul 10, 2008
  6. Petr BaudisJul 10, 2008
  7. Stephan HennigJul 10, 2008
  8. Stephan HennigJul 11, 2008
  9. Andreas EricssonJul 11, 2008
  10. Johannes SchindelinJul 11, 2008
  11. Stephan HennigJul 12, 2008
  12. Johannes SchindelinJul 12, 2008
  13. Shawn O. PearceJul 13, 2008
  14. Johannes SchindelinJul 13, 2008
  15. Shawn O. PearceJul 13, 2008
  16. 0/4 Honor core.deltaBaseCacheLimit during index-packShawn O. Pearce, Jul 14, 2008
  17. 1/4 index-pack: Refactor base arguments of resolve_delta into a structShawn O. Pearce, Jul 14, 2008
  18. 2/4 index-pack: Chain the struct base_data on the stack for traversalShawn O. Pearce, Jul 14, 2008
  19. 3/4 index-pack: Track the object_entry that creates each base_dataShawn O. Pearce, Jul 14, 2008
  20. 4/4 index-pack: Honor core.deltaBaseCacheLimit when resolving deltasShawn O. Pearce, Jul 14, 2008
  21. Nicolas PitreJul 15, 2008
  22. Shawn O. PearceJul 15, 2008
  23. index-pack: Honor core.deltaBaseCacheLimit when resolving deltasShawn O. Pearce, Jul 15, 2008
  24. Nicolas PitreJul 15, 2008
  25. Junio C HamanoJul 15, 2008
  26. Johannes SchindelinJul 14, 2008
  27. Nicolas PitreJul 15, 2008
  28. Shawn O. PearceJul 15, 2008
  29. Nicolas PitreJul 15, 2008
  30. Nicolas PitreJul 15, 2008
  31. Nicolas PitreJul 15, 2008
  32. Nicolas PitreJul 14, 2008
  33. Shawn O. PearceJul 14, 2008
  34. Johannes SchindelinJul 14, 2008
  35. Jakub NarebskiJul 14, 2008
  36. Johannes SchindelinJul 14, 2008
  37. Andreas EricssonJul 14, 2008
  38. Johannes SchindelinJul 14, 2008
  39. Andreas EricssonJul 14, 2008
  40. Johannes SchindelinJul 14, 2008
  41. Nicolas PitreJul 15, 2008
  42. Shawn O. PearceJul 15, 2008
  43. Nicolas PitreJul 15, 2008
  44. Stephan HennigJul 17, 2008
  45. Nicolas PitreJul 17, 2008
  46. Shawn O. PearceJul 17, 2008
  47. index-pack: Issue a warning if deltaBaseCacheLimit is too smallShawn O. Pearce, Jul 17, 2008
  48. Nicolas PitreJul 17, 2008
  49. Shawn O. PearceJul 15, 2008
  50. Stephan HennigJul 13, 2008
  51. Stephan HennigJul 11, 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.