From 7b160fbb76aa2b48a267e82cbdca8c1f015ff647 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 26 Aug 2021 23:13:51 +0200 Subject: [PATCH] perf: use performance-enhancing FUSE mount options --- fuse/mount/fuse.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fuse/mount/fuse.go b/fuse/mount/fuse.go index c317f5e7d..7fd29e33d 100644 --- a/fuse/mount/fuse.go +++ b/fuse/mount/fuse.go @@ -33,12 +33,16 @@ func NewMount(p goprocess.Process, fsys fs.FS, mountpoint string, allow_other bo var conn *fuse.Conn var err error - if allow_other { - conn, err = fuse.Mount(mountpoint, fuse.AllowOther()) - } else { - conn, err = fuse.Mount(mountpoint) + var mountOpts = []fuse.MountOption{ + fuse.MaxReadahead(64 * 1024 * 1024), + fuse.AsyncRead(), } + if allow_other { + mountOpts = append(mountOpts, fuse.AllowOther()) + } + conn, err = fuse.Mount(mountpoint, mountOpts...) + if err != nil { return nil, err }