adjust Repeat benchmark

This commit is contained in:
go101 2018-08-22 11:55:40 -04:00
parent 54d85542b0
commit 4b2c73f3bf
1 changed files with 4 additions and 4 deletions

View File

@ -1647,10 +1647,10 @@ func BenchmarkSplitNMultiByteSeparator(b *testing.B) {
} }
func BenchmarkRepeat(b *testing.B) { func BenchmarkRepeat(b *testing.B) {
s := Repeat("-", 16) s := "0123456789"
for n := 1; n <= 16; n <<= 1 { for _, n := range []int{5, 10} {
for _, c := range []int{2, 6, 10} { for _, c := range []int{1, 2, 6} {
b.Run(fmt.Sprintf("length=%d-count=%d", n, c), func(b *testing.B) { b.Run(fmt.Sprintf("%dx%d", n, c), func(b *testing.B) {
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
Repeat(s[:n], c) Repeat(s[:n], c)
} }