From 4b2c73f3bfa0b3789268b9ea6e1ecdb984e8087c Mon Sep 17 00:00:00 2001 From: go101 Date: Wed, 22 Aug 2018 11:55:40 -0400 Subject: [PATCH] adjust Repeat benchmark --- src/strings/strings_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strings/strings_test.go b/src/strings/strings_test.go index 50bac5d465..b5c6485749 100644 --- a/src/strings/strings_test.go +++ b/src/strings/strings_test.go @@ -1647,10 +1647,10 @@ func BenchmarkSplitNMultiByteSeparator(b *testing.B) { } func BenchmarkRepeat(b *testing.B) { - s := Repeat("-", 16) - for n := 1; n <= 16; n <<= 1 { - for _, c := range []int{2, 6, 10} { - b.Run(fmt.Sprintf("length=%d-count=%d", n, c), func(b *testing.B) { + s := "0123456789" + for _, n := range []int{5, 10} { + for _, c := range []int{1, 2, 6} { + b.Run(fmt.Sprintf("%dx%d", n, c), func(b *testing.B) { for i := 0; i < b.N; i++ { Repeat(s[:n], c) }