diff --git a/benchmark/benchmark.go b/benchmark/benchmark.go index 3180d5e8bc2b3e49e7ccaae94eb8a7f3fd60edb9..a59f19995a3a07ceb6caac55bd0b4405919db5fb 100644 --- a/benchmark/benchmark.go +++ b/benchmark/benchmark.go @@ -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) { diff --git a/benchmark/stat_test.go b/benchmark/stat_test.go index 8be5fbe3f760951811b60add94bb0a92c7a1c710..d7f5159a76adda835afa7184e2e27bf43e48a66b 100644 --- a/benchmark/stat_test.go +++ b/benchmark/stat_test.go @@ -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) }