diff --git a/entropy/entropy.go b/entropy/entropy.go index 8c17b17..b66541a 100644 --- a/entropy/entropy.go +++ b/entropy/entropy.go @@ -152,7 +152,7 @@ randStr is an overoptimized (read: dummy fast) random string generator. at 55,555 characters, we are at: - ~57,000 bytes per op with string builders + ~57,000 bytes per op with byte builders vs ~210,000 bytes per op with string builders. diff --git a/entropy/entropy_test.go b/entropy/entropy_test.go index cbb69ef..5e78e64 100644 --- a/entropy/entropy_test.go +++ b/entropy/entropy_test.go @@ -168,13 +168,13 @@ func Test_RNGUint32(t *testing.T) { func Benchmark_RandStr(b *testing.B) { toTest := []int{5, 25, 55, 500, 55555} - for n := range toTest { + for _, ln := range toTest { for i := 1; i != 5; i++ { - b.Run(fmt.Sprintf("lenSeries%d/run%d", n, i), func(b *testing.B) { + b.Run(fmt.Sprintf("len%d/run%d", ln, i), func(b *testing.B) { b.ReportAllocs() b.ResetTimer() for tn := 0; tn != b.N; tn++ { - RandStr(n) + RandStr(ln) } }) }