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

Re: [PATCH] Limit the size of the new delta_base_cache

From
Nicolas Pitre <nico@cam.org>
Date
Mar 19, 2007, 16:54 UTC
Message-ID
<alpine.LFD.0.83.0703191248360.18328@xanadu.home>
In-Reply-To
<alpine.LFD.0.83.0703191218190.18328@xanadu.home>
On Mon, 19 Mar 2007, Nicolas Pitre wrote:
Show 7 quoted lines
> And because we usually walk objects from newest to oldest, and because 
> deltas are usually oriented in the same direction, we only need to tweak 
> the current eviction loop a bit so on average the oldest objects are 
> evicted first so next time around the current base will still be there 
> for the next delta depth.  Given the nature of the hash containing the 
> object's offset that means starting the loop at the next entry index 
> instead of zero which should do the trick pretty well.

OK. Two flaws above: to be clear it is the newest objects in terms of absolute age should be evicted first, which means the oldest to have been cached. Then the hash cannot be representative of the object ordering because it is reduced to 8 bits and objects are often enough more than 256 bytes apart to make this hash based ordering completely random. A simple LRU might be quite effective instead.

Nicolas
Previous: Nicolas PitreNext: Linus Torvalds
Message 4 of 8 in “Limit the size of the new delta_base_cache”
  1. Limit the size of the new delta_base_cacheShawn O. Pearce, Mar 19, 2007
  2. Linus TorvaldsMar 19, 2007
  3. Nicolas PitreMar 19, 2007
  4. Nicolas PitreMar 19, 2007
  5. Linus TorvaldsMar 19, 2007
  6. Linus TorvaldsMar 19, 2007
  7. Linus TorvaldsMar 19, 2007
  8. Nicolas PitreMar 19, 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.