Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 39f6487

Browse files
committed
add more benchmark code and update .gitignore
1 parent ef857c2 commit 39f6487

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
.DS_Store
33
.vscode
44
.idea
5+
#
6+
dfa.gv
7+
trie.gv
58

69
# Debug files
710
*.dSYM/

cedar_bm_test.go

+34
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,37 @@ func BenchmarkPrefixMatch(t *testing.B) {
1717

1818
tt.BM(t, fn)
1919
}
20+
21+
func BenchmarkInsert(t *testing.B) {
22+
fn := func() {
23+
cd.Insert([]byte("a"), 1)
24+
cd.Insert([]byte("b"), 3)
25+
cd.Insert([]byte("d"), 6)
26+
}
27+
28+
tt.BM(t, fn)
29+
}
30+
31+
func BenchmarkJump(t *testing.B) {
32+
fn := func() {
33+
cd.Jump([]byte("a"), 1)
34+
}
35+
36+
tt.BM(t, fn)
37+
}
38+
39+
func BenchmarkKey(t *testing.B) {
40+
fn := func() {
41+
cd.Key(1)
42+
}
43+
44+
tt.BM(t, fn)
45+
}
46+
47+
func BenchmarkValue(t *testing.B) {
48+
fn := func() {
49+
cd.Value(1)
50+
}
51+
52+
tt.BM(t, fn)
53+
}

0 commit comments

Comments
 (0)