Report waste as a fraction

This commit is contained in:
Sasha Koshka 2024-09-19 09:20:44 -04:00
parent cde84b8756
commit aa486fe660

View File

@ -155,9 +155,7 @@ func BenchmarkParseStringLatin (benchmark *testing.B) {
}
meanLen /= benchmark.N
meanCap /= benchmark.N
benchmark.ReportMetric(float64(meanLen), "len")
benchmark.ReportMetric(float64(meanCap), "cap")
benchmark.ReportMetric(float64(meanCap - meanLen), "waste")
benchmark.ReportMetric(float64(meanCap) / float64(meanLen), "waste")
}
func BenchmarkParseStringChinese (benchmark *testing.B) {
@ -170,9 +168,7 @@ func BenchmarkParseStringChinese (benchmark *testing.B) {
}
meanLen /= benchmark.N
meanCap /= benchmark.N
benchmark.ReportMetric(float64(meanLen), "len")
benchmark.ReportMetric(float64(meanCap), "cap")
benchmark.ReportMetric(float64(meanCap - meanLen), "waste")
benchmark.ReportMetric(float64(meanCap) / float64(meanLen), "waste")
}
const lipsumLt =