We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0cd3db commit d800ff7Copy full SHA for d800ff7
1 file changed
hash/hashutil/bloom/bloomf_test.go
@@ -4,8 +4,8 @@ import (
4
"testing"
5
)
6
7
-func Test(t *testing.T) {
8
- t.Run("Bloom", func(t *testing.T) {
+func TestBloom(t *testing.T) {
+ t.Run("bloom-3", func(t *testing.T) {
9
var list = []string{
10
"apple",
11
"banana",
@@ -23,3 +23,25 @@ func Test(t *testing.T) {
23
}
24
})
25
26
+
27
+func BenchmarkBloom(b *testing.B) {
28
+ var list = []string{
29
+ "apple",
30
+ "banana",
31
+ "cherry",
32
+ "golang",
33
+ "python",
34
+ "ruby",
35
+ "rust",
36
+ "java",
37
+ }
38
+ bf := NewBloom(uint64(len(list)), 0.01)
39
+ for _, s := range list {
40
+ bf.SetString(s)
41
42
43
+ b.ResetTimer()
44
+ for i := 0; i < b.N; i++ {
45
+ bf.GetString("apple")
46
47
+}
0 commit comments