mirror of
https://github.com/Jguer/yay
synced 2024-09-06 16:43:03 +00:00
28 lines
603 B
Go
28 lines
603 B
Go
![]() |
package main
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func benchmarkSearch(search string, b *testing.B) {
|
||
|
for n := 0; n < b.N; n++ {
|
||
|
queryRepo(append([]string{}, search))
|
||
|
}
|
||
|
}
|
||
|
func BenchmarkSearchSimpleTopDown(b *testing.B) {
|
||
|
config.SortMode = TopDown
|
||
|
benchmarkSearch("chromium", b)
|
||
|
}
|
||
|
|
||
|
func BenchmarkSearchSimpleBottomUp(b *testing.B) {
|
||
|
config.SortMode = BottomUp
|
||
|
benchmarkSearch("chromium", b)
|
||
|
}
|
||
|
|
||
|
func BenchmarkSearchComplexTopDown(b *testing.B) {
|
||
|
config.SortMode = TopDown
|
||
|
benchmarkSearch("linux", b)
|
||
|
}
|
||
|
func BenchmarkSearchComplexBottomUp(b *testing.B) {
|
||
|
config.SortMode = BottomUp
|
||
|
benchmarkSearch("linux", b)
|
||
|
}
|