Don't cap GOMAXPROCS at 4.
Before Go 1.5, GOMAXPROCS defaulted to 1, hence it made sense to unconditionally increase it to 4. But since Go 1.5, GOMAXPROCS defaults to the number of cores, so don't keep it from increasing above 4. Also, update the performance numbers.
This commit is contained in:
parent
f44902aaae
commit
53b7c17261
@ -28,6 +28,7 @@ v1.2.1-33 112 21 12 1.6 4.4 (go1.8)
|
||||
v1.2.1-33
|
||||
-serialize_reads 116 21 39 1.5 4.4
|
||||
v1.3-27 113 20 11 1.4 4.2
|
||||
v1.3-53-gf44902a 119 19 12 1.6 4.1
|
||||
|
||||
Results for EncFS for comparison (benchmark.bash -encfs):
|
||||
|
||||
|
9
main.go
9
main.go
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user