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

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 12 13:15:10 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/119761.diff


1 Files Affected:

- (modified) libcxx/utils/libcxx/test/format.py (+1-1) 


``````````diff
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(

``````````

</details>


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


More information about the libcxx-commits mailing list