Page MenuHomeSoftware Heritage

Cache directory entries to make readdir/lookup more efficient
Open, NormalPublic

Event Timeline

haltode triaged this task as Normal priority.Tue, Oct 13, 12:12 PM
haltode created this task.
haltode created this object in space S1 Public.
seirl added a subscriber: seirl.Tue, Oct 13, 12:13 PM

lookup() should ideally be O(1).

haltode added a comment.EditedTue, Oct 13, 12:56 PM

From the design doc:

	### Dentry cache
	    dir SWHID → directory entries
	The dentry (directory entry) cache map SWHIDs of type `dir` to the directory
	entries they contain. Each entry comes with its name as well as file attributes
	(i.e., all its needed to perform a detailed directory listing).
	Additional attributes of each directory entry should be looked up on a entry by
	entry basis, possibly hitting the metadata cache.
	The dentry cache for a given dir is populated, at the latest, when the content
	of the directory is listed. More aggressive prefetching might happen. For
	instance, when first opening a dir a recursive listing of it can be retrieved
	from the remote backend and used to recursively populate the dentry cache for
	all (transitive) sub-directories.

Might not be implemented as entries inside the sqlite disk cache but probably in-memory inside FuseEntry class.