diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/hanwen/go-fuse/fuse" + "github.com/rfjakob/gocryptfs/internal/configfile" "github.com/rfjakob/gocryptfs/internal/contentenc" "github.com/rfjakob/gocryptfs/internal/exitcodes" @@ -18,7 +20,6 @@ import ( "github.com/rfjakob/gocryptfs/internal/speed" "github.com/rfjakob/gocryptfs/internal/stupidgcm" "github.com/rfjakob/gocryptfs/internal/tlog" - "github.com/hanwen/go-fuse/fuse" ) // GitVersion is the gocryptfs version according to git, set by build.bash @@ -111,7 +112,11 @@ func printVersion() { } func main() { - runtime.GOMAXPROCS(4) + mxp := runtime.GOMAXPROCS(0) + if mxp < 4 { + // On a 2-core machine, setting maxprocs to 4 gives 10% better performance + runtime.GOMAXPROCS(4) + } var err error // Parse all command-line options (i.e. arguments starting with "-") // into "args". Path arguments are parsed below. |