git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Questions on delta base cache fetching
@ 2019-11-23 19:54 Matheus Tavares Bernardino
  0 siblings, 0 replies; only message in thread
From: Matheus Tavares Bernardino @ 2019-11-23 19:54 UTC (permalink / raw)
  To: git

Hi, everyone

A few questions popped into my head regarding unpacking functions that
fetch from the delta base cache. Their behavior on the cached entries
sometimes seemed a little counterintuitive for me, so I hoped you
could help me better understand.

1. If cache_or_unpack_entry() finds the desired object in cache, it
just retrieves and returns the entry, not updating its position in the
LRU list. Shouldn't it do so (possibly by removing and re-inserting
the entry)? Or maybe shouldn't the retrieval function itself do the
update?

2. While resolving a delta chain, unpack_entry() checks if the base is
in cache and removes it if so. At first, this seemed a little odd to
me, but the entry is re-inserted at phase 3. FWIU, this is done to
update the entry's position in the LRU list, is that right?

However, if the function is called to unpack a base object which is
already in cache, it will just remove the cache entry and don't
re-insert it (as it won't go through phase 3). Calling the
cache_or_unpack_entry() "wrapper", thought, will, in this case, return
the cache entry without removing it (nor calling unpack_entry()). To
avoid removing recently used entries from the cache, shouldn't
external callers, perhaps, always call the wrapper instead of
unpack_entry()?

Thanks,
Matheus

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-23 19:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 19:54 Questions on delta base cache fetching Matheus Tavares Bernardino

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).