Fix[entropy]: Fix typo in docs and benchmark code
This commit is contained in:
parent
b4aea38e0b
commit
9ecc1d1677
@ -152,7 +152,7 @@ randStr is an overoptimized (read: dummy fast) random string generator.
|
|||||||
|
|
||||||
at 55,555 characters, we are at:
|
at 55,555 characters, we are at:
|
||||||
|
|
||||||
~57,000 bytes per op with string builders
|
~57,000 bytes per op with byte builders
|
||||||
vs
|
vs
|
||||||
~210,000 bytes per op with string builders.
|
~210,000 bytes per op with string builders.
|
||||||
|
|
||||||
|
@ -168,13 +168,13 @@ func Test_RNGUint32(t *testing.T) {
|
|||||||
|
|
||||||
func Benchmark_RandStr(b *testing.B) {
|
func Benchmark_RandStr(b *testing.B) {
|
||||||
toTest := []int{5, 25, 55, 500, 55555}
|
toTest := []int{5, 25, 55, 500, 55555}
|
||||||
for n := range toTest {
|
for _, ln := range toTest {
|
||||||
for i := 1; i != 5; i++ {
|
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.ReportAllocs()
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for tn := 0; tn != b.N; tn++ {
|
for tn := 0; tn != b.N; tn++ {
|
||||||
RandStr(n)
|
RandStr(ln)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user