-
Notifications
You must be signed in to change notification settings - Fork 1
/
salt_test.go
50 lines (43 loc) · 1.06 KB
/
salt_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import "testing"
func BenchmarkRandStringBytesMaskImpr8x64(b *testing.B) {
// run the randStringBytesMaskImpr function b.N times
for n := 0; n < b.N; n++ {
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
randStringBytesMaskImpr(64)
}
}
func BenchmarkRandStringBytesMaskImpr512(b *testing.B) {
// run the randStringBytesMaskImpr function b.N times
for n := 0; n < b.N; n++ {
randStringBytesMaskImpr(512)
}
}
func BenchmarkGenerateSaltsWP512(b *testing.B) {
for n := 0; n < b.N; n++ {
generateSaltsWPEfficient()
}
}
func BenchmarkGenerateSaltsEnv512(b *testing.B) {
for n := 0; n < b.N; n++ {
generateSaltsEnvEfficient()
}
}
func BenchmarkGenerateSaltsJSON512(b *testing.B) {
for n := 0; n < b.N; n++ {
generateSaltsJSONEfficient()
}
}
func BenchmarkSrcInt63Parallel(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
randStringBytesMaskImpr(512)
}
})
}