4 ms·
What you describe is an over-specialized optimization that very few users would benefit from, but would still introduce significant complexity. Linux already t
by m000 5y ago
What you describe is an over-specialized optimization that very few users would benefit from, but would still introduce significant complexity.
Linux already transparently caches filesystem metadata. You already get a good speedup if you attempt the same directory walk twice, and not much have changed in the filesystem.
- gorgoiler 5y agoMy desktop has ~2MB of basenames on it. Memory isn’t free, and there’s more to an inode than a filename, but it seems odd that this data that’s the size of a cat photo doesn’t get special treatment over other vm cache data.
- thanatos519 5y agoThat's tunable, and apparently the default is reasonable: https://sysctl-explorer.net/vm/vfs_cache_pressure/ https://sysctl-explorer.net/vm/vfs_cache_pressure/ My workstation has 64GB of RAM and only ~7M directory entries so I have 'vm.vfs_cache_pressure = 1' in /etc/sysctl.conf and cache everything with a full directory traversal via find. The first time it takes 52s; subsequent times take 5s. It has never given me memory problems.
- spicybright 5y agoI'm assuming the cache isn't kept on disk tho, right? As in 52s the first time since boot, 5+ for subsequent runs (incorporating time for changed files/directories)