From f8ad2ac3e252108ccfedd115eb3009a5a7d77106 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 17 May 2020 21:37:36 +0200 Subject: dircache: increase cache size & lifetime Looking at the dircache debug output, we see that a "git status" workload has a very bad cache hit rate because the entries expire or get evicted before they can be reused. Increase both cache size and lifetime for a 4x speedup: Before: 75s After: 17s https://github.com/rfjakob/gocryptfs/issues/410 --- tests/test_helpers/mount_unmount.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test_helpers') diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go index cdbdee8..76db41c 100644 --- a/tests/test_helpers/mount_unmount.go +++ b/tests/test_helpers/mount_unmount.go @@ -14,6 +14,11 @@ import ( "time" ) +// gocryptfs may hold up to maxCacheFds open for caching +// Keep in sync with fusefrontend.dirCacheSize +// TODO: How to share this constant without causing an import cycle?! +const maxCacheFds = 20 + // Indexed by mountpoint. Initialized in doInit(). var MountInfo map[string]mountInfo @@ -137,11 +142,6 @@ func UnmountPanic(dir string) { } } -// gocryptfs may hold up to maxCacheFds open for caching -// Keep in sync with fusefrontend.dirCacheSize -// TODO: How to share this constant without causing an import cycle?! -const maxCacheFds = 3 - // UnmountErr tries to unmount "dir", retrying 10 times, and returns the // resulting error. func UnmountErr(dir string) (err error) { -- cgit v1.2.3