blob: a4993c2f341a18c5b1a8101520c69a9422e0ba7b [file] [log] [blame]
// +build ignore,OMIT
package main
import (
"fmt"
"testing"
)
func benchFunc(b *testing.B, f func(int) map[int]int) {
for n := 10; n <= 10000; n *= 10 {
b.Run(fmt.Sprint(n), func(b *testing.B) {
for i := 0; i < b.N; i++ {
f(n)
}
})
}
}
func BenchmarkNarrowSection(b *testing.B) { benchFunc(b, countFactorsNarrowSection) }
func BenchmarkWideSection(b *testing.B) { benchFunc(b, countFactorsWideSection) }
func BenchmarkSq(b *testing.B) { benchFunc(b, countFactorsSeq) }