mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
Add a simple benchmark for Scratch
This commit is contained in:
1 parent
7c84e6b3e3
commit
b5bced1db4
1 file changed
+9
@@ -143,3 +143,12 @@ func TestScratchGetSortedMapValues(t *testing.T) {
|
|||||||
t.Errorf("Should not return anything, but got %v", nothing)
|
t.Errorf("Should not return anything, but got %v", nothing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BenchmarkScratchGet(b *testing.B) {
|
||||||
|
scratch := newScratch()
|
||||||
|
scratch.Add("A", 1)
|
||||||
|
b.ResetTimer()
|
||||||
|
for i := 0; i < b.N; i++ {
|
||||||
|
scratch.Get("A")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user