mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add a simple benchmark for Scratch
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user