blob: 2bbb3ce079122a7c776b905141ac034f03f10cec [file] [log] [blame]
// +build 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) }