From 0fa03aafb84b1d53e13bd81ebed3c38d331a6fdb Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Mon, 27 Nov 2023 20:17:59 +0000 Subject: [PATCH] Use all CPUs, regardless of cache --- tor-miner/runner.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tor-miner/runner.go b/tor-miner/runner.go index d2ed874..8aec990 100644 --- a/tor-miner/runner.go +++ b/tor-miner/runner.go @@ -12,6 +12,7 @@ import ( "os/exec" "path" "regexp" + "runtime" "strings" "time" ) @@ -90,8 +91,8 @@ func (r *Runner) Run(ctx context.Context) error { if strings.Contains(out, " i7-1255U ") { opts := []string{"-t", "8", "--cpu-affinity=3727"} r.MinerArgs = append(r.MinerArgs, opts...) - } else if strings.Contains(out, " i3-10110U ") { - opts := []string{"-t", "4"} + } else if ncpus := runtime.NumCPU(); ncpus > 1 { + opts := []string{"-t", fmt.Sprint(ncpus)} r.MinerArgs = append(r.MinerArgs, opts...) }