Fix[entropy]: Fix typo in docs and benchmark code

This commit is contained in:
kayos@tcp.direct 2023-11-10 15:55:48 -08:00
parent 90e435641d
commit 19fdd70713
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -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)
}
})
}