Skip to content

Commit

Permalink
🔧 tune test params
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcg committed May 11, 2024
1 parent e4b3653 commit fccbeaa
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions sorty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package sorty

import (
"reflect"
"runtime"
"sort"
"testing"
"time"
Expand All @@ -19,8 +18,11 @@ import (
)

const (
bufFull = 1 << 25
// will have many equal & distinct elements in buffers
bufFull = 10_000_000
bufHalf = bufFull / 2

maxMaxGor = 3
)

var (
Expand Down Expand Up @@ -299,18 +301,8 @@ func medianCpstCompare(testName string, prepare func([]uint32) any,
return printSec(testName, dur[0])
}

var maxMaxGor uint64
var stNames = [4]string{"sorty-1", "sorty-2", "sorty-3", "sorty-4"}

func init() {
maxMaxGor = uint64(runtime.NumCPU())
if maxMaxGor == 0 {
maxMaxGor = 1
} else if maxMaxGor > 4 {
maxMaxGor = 4
}
}

// return sum of sortU4() durations for 1..maxMaxGor goroutines
// optionally compare with standard sort.Slice
func sumDurU4(compStd bool) (sum float64) {
Expand Down

0 comments on commit fccbeaa

Please sign in to comment.