From 3b7424c4f7378995271c43bcf1b4c0aa85e680d8 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Fri, 3 May 2024 21:41:53 +0200 Subject: [PATCH] lower default concurrency factor to 4 I couldn't see a performance difference on newer kernels, faster on older ones, overall when not profiling I now do reliable 4GiB/s with peaks at 5GiB/s since moving from sha256. The single core performance is where the most improvement is seen, when hashing really big files it used to do it at 800MiB/s it now does it at 1.6GiB/s. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 20a7c8a..3dd7d87 100644 --- a/main.go +++ b/main.go @@ -326,7 +326,7 @@ func dedup(backoff chan struct{}, length uint64, paths ...string) { } func main() { - concurrencyFactor := flag.Int("cf", 16, "define the concurrency factor, this allows to set the amount of workers run per linux core, use GOMAXPROCS env to configure the number of cores used.") + concurrencyFactor := flag.Int("cf", 4, "define the concurrency factor, this allows to set the amount of workers run per linux core, use GOMAXPROCS env to configure the number of cores used.") cpuprofile := flag.String("cpuprofile", "", "write cpu profile to `file`") onlyScan := flag.Bool("only-scan", false, "only scan and do not dedup") flag.Parse()