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 { ...@@ -43,8 +43,6 @@ func ReadLines(name string) []string {
func BulkStat(parallelism int, files []string) float64 { func BulkStat(parallelism int, files []string) float64 {
todo := make(chan string, len(files)) todo := make(chan string, len(files))
dts := make(chan time.Duration, parallelism) dts := make(chan time.Duration, parallelism)
fmt.Printf("Statting %d files with %d threads\n", len(files), parallelism)
for i := 0; i < parallelism; i++ { for i := 0; i < parallelism; i++ {
go func() { go func() {
t := time.Now() t := time.Now()
...@@ -108,11 +106,11 @@ func AnalyzeBenchmarkRuns(label string, times []float64) { ...@@ -108,11 +106,11 @@ func AnalyzeBenchmarkRuns(label string, times []float64) {
fmt.Printf( fmt.Printf(
"%s: %d samples\n"+ "%s: %d samples\n"+
"avg %.3fms 2sigma %.3fms "+ "avg %.3fms +/- %.0f%% "+
"median %.3fms\n"+ "median %.3fms, 10%%tiles: [-%.0f%%, +%.0f%%]\n",
"10%%tile %.3fms, 90%%tile %.3fms\n",
label, 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) { func RunBulkStat(runs int, threads int, sleepTime time.Duration, files []string) (results []float64) {
......
...@@ -101,7 +101,7 @@ func BenchmarkGoFuseThreadedStat(b *testing.B) { ...@@ -101,7 +101,7 @@ func BenchmarkGoFuseThreadedStat(b *testing.B) {
threads := runtime.GOMAXPROCS(0) threads := runtime.GOMAXPROCS(0)
results := TestingBOnePass(b, threads, files) 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) { func TestingBOnePass(b *testing.B, threads int, files []string) (results []float64) {
...@@ -174,5 +174,5 @@ func BenchmarkCFuseThreadedStat(b *testing.B) { ...@@ -174,5 +174,5 @@ func BenchmarkCFuseThreadedStat(b *testing.B) {
os.Lstat(mountPoint) os.Lstat(mountPoint)
threads := runtime.GOMAXPROCS(0) threads := runtime.GOMAXPROCS(0)
results := TestingBOnePass(b, threads, lines) 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