[libcxx-commits] [libcxx] [libc++] Save benchmark results in a json file (PR #119761)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 12 13:14:33 PST 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/119761

When running a benchmark, also save the benchmark results in a JSON file. That is cheap to do and useful to compare benchmark results between different runs.

>From 162028f16a9ae44c8b841c73f6a761b3236101c7 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 12 Dec 2024 16:12:48 -0500
Subject: [PATCH] [libc++] Save benchmark results in a json file

When running a benchmark, also save the benchmark results in a JSON
file. That is cheap to do and useful to compare benchmark results
between different runs.
---
 libcxx/utils/libcxx/test/format.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index f69a7dfedef2d5..59d0fffd378191 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -348,7 +348,7 @@ def execute(self, test, litConfig):
                 "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} %{benchmark_flags} %{link_flags} -o %t.exe",
             ]
             if "enable-benchmarks=run" in test.config.available_features:
-                steps += ["%dbg(EXECUTED AS) %{exec} %t.exe"]
+                steps += ["%dbg(EXECUTED AS) %{exec} %t.exe --benchmark_out=%T/benchmark-result.json --benchmark_out_format=json"]
             return self._executeShTest(test, litConfig, steps)
         else:
             return lit.Test.Result(



More information about the libcxx-commits mailing list