[libcxx-commits] [libcxx] 966b521 - [libc++] Fix the formatting for percents in compare-benchmarks

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 17 10:03:17 PST 2025


Author: Louis Dionne
Date: 2025-12-17T13:03:11-05:00
New Revision: 966b5217e60f3aa0721e074d92507762970e3c2f

URL: https://github.com/llvm/llvm-project/commit/966b5217e60f3aa0721e074d92507762970e3c2f
DIFF: https://github.com/llvm/llvm-project/commit/966b5217e60f3aa0721e074d92507762970e3c2f.diff

LOG: [libc++] Fix the formatting for percents in compare-benchmarks

We would output 0.5% instead of 50%.

Added: 
    

Modified: 
    libcxx/utils/compare-benchmarks

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/compare-benchmarks b/libcxx/utils/compare-benchmarks
index b9489073568d0..c862f6c80bad5 100755
--- a/libcxx/utils/compare-benchmarks
+++ b/libcxx/utils/compare-benchmarks
@@ -87,8 +87,8 @@ def create_chart(data, metric, subtitle=None, series_names=None):
     return figure
 
 def produce_kpis(data, noise, extrema, series, series_names, meta_candidate, title):
-    addendum = f"{noise}% noise threshold, based on {len(data)} benchmarks"
-    top_addendum = f"by >= {extrema}%, {noise}% noise threshold, based on {len(data)} benchmarks"
+    addendum = f"{noise:.0%} noise threshold, based on {len(data)} benchmarks"
+    top_addendum = f"by >= {extrema:.0%}, {noise:.0%} noise threshold, based on {len(data)} benchmarks"
     headers = [title if title else '']
     columns = [[
         f'Benchmarks where {meta_candidate} is faster than {series_names[0]} ({addendum})',


        


More information about the libcxx-commits mailing list