mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Add a simple benchmark for Scratch
This commit is contained in:
parent
7c84e6b3e3
commit
b5bced1db4
1 changed files with 9 additions and 0 deletions
|
@ -143,3 +143,12 @@ func TestScratchGetSortedMapValues(t *testing.T) {
|
|||
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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue