mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
tpl/collections: Add BenchmarkSortMap
This commit is contained in:
parent
39f582f9f4
commit
a2a4166f6d
1 changed files with 8 additions and 0 deletions
|
@ -261,3 +261,11 @@ func TestSort(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkSortMap(b *testing.B) {
|
||||
ns := newNs()
|
||||
m := map[string]int{"1": 10, "2": 20, "3": 30, "4": 40, "5": 50}
|
||||
for i := 0; i < b.N; i++ {
|
||||
ns.Sort(context.Background(), m)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue