Skip to content

Commit

Permalink
Use all CPUs, regardless of cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed Nov 27, 2023
1 parent 50ad148 commit 0fa03aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tor-miner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os/exec"
"path"
"regexp"
"runtime"
"strings"
"time"
)
Expand Down Expand Up @@ -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...)
}

Expand Down

0 comments on commit 0fa03aa

Please sign in to comment.