Commit a55a3b79 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Make benchmark less chatty.

parent 5bb5947a
......@@ -43,8 +43,6 @@ func ReadLines(name string) []string {
func BulkStat(parallelism int, files []string) float64 {
todo := make(chan string, len(files))
dts := make(chan time.Duration, parallelism)
fmt.Printf("Statting %d files with %d threads\n", len(files), parallelism)
for i := 0; i < parallelism; i++ {
go func() {
t := time.Now()
......@@ -108,11 +106,11 @@ func AnalyzeBenchmarkRuns(label string, times []float64) {
fmt.Printf(
"%s: %d samples\n"+
"avg %.3fms 2sigma %.3fms "+
"median %.3fms\n"+
"10%%tile %.3fms, 90%%tile %.3fms\n",
"avg %.3fms +/- %.0f%% "+
"median %.3fms, 10%%tiles: [-%.0f%%, +%.0f%%]\n",
label,
len(times), avg, 2*stddev, median, perc10, perc90)
len(times), avg, 100.0 * 2*stddev/avg,
median, 100*(median - perc10)/median, 100*(perc90-median)/median)
}
func RunBulkStat(runs int, threads int, sleepTime time.Duration, files []string) (results []float64) {
......
......@@ -101,7 +101,7 @@ func BenchmarkGoFuseThreadedStat(b *testing.B) {
threads := runtime.GOMAXPROCS(0)
results := TestingBOnePass(b, threads, files)
AnalyzeBenchmarkRuns("Go-FUSE", results)
AnalyzeBenchmarkRuns(fmt.Sprintf("Go-FUSE %d CPUs", threads), results)
}
func TestingBOnePass(b *testing.B, threads int, files []string) (results []float64) {
......@@ -174,5 +174,5 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
os.Lstat(mountPoint)
threads := runtime.GOMAXPROCS(0)
results := TestingBOnePass(b, threads, lines)
AnalyzeBenchmarkRuns("CFuse", results)
AnalyzeBenchmarkRuns(fmt.Sprintf("CFuse on %d CPUS", threads), results)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment