Skip to content

Resolve "Add dentry cache"

Marc Vef requested to merge marc/292-add-dentry-cache into master

This MR adds a directory entry cache for the client to avoid a huge number of stat calls after readdir, e.g., for ls -l type operations. It is experimental and thus disabled by default. Can be enabled via include/config.hpp or with the env variable LIBGKFS_DENTRY_CACHE=ON/OFF.

It works by using the extended_dir_entry RPC to receive some metadata along the the dentries from the daemons. This metadata is then placed into the cache and retrieved in a stat operation (for a cache miss, an RPC is sent with vanilla functionality). The cache is discarded upon close but can be changed via include/config.hpp. Note, this may cause semantical issues (removed files will remain in the cache forever).

The performance improvements are already noticeable locally for a couple 1000 files.

Depends on !195 (merged)

Closes #292 (closed)

Edited by Marc Vef

Merge request reports