From aa486fe660b390299f5ba29794501689a8c3575f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 19 Sep 2024 09:20:44 -0400 Subject: [PATCH] Report waste as a fraction --- parse_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/parse_test.go b/parse_test.go index 365a5ab..570f5e1 100644 --- a/parse_test.go +++ b/parse_test.go @@ -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 =