[libcxx-commits] [libcxx] [llvm] [libc++] Unify the benchmarks with the test suite (PR #101399)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 5 08:45:15 PDT 2024


================
@@ -438,48 +442,20 @@ Libc++ contains benchmark tests separately from the test of the test suite.
 The benchmarks are written using the `Google Benchmark`_ library, a copy of which
 is stored in the libc++ repository.
 
-For more information about using the Google Benchmark library see the
+For more information about using the Google Benchmark library, see the
 `official documentation <https://github.com/google/benchmark>`_.
 
-.. _`Google Benchmark`: https://github.com/google/benchmark
-
-Building Benchmarks
--------------------
-
-The benchmark tests are not built by default. The benchmarks can be built using
-the ``cxx-benchmarks`` target.
-
-An example build would look like:
-
-.. code-block:: bash
-
-  $ ninja -C build cxx-benchmarks
-
-This will build all of the benchmarks under ``<libcxx>/test/benchmarks`` to be
-built against the just-built libc++. The compiled tests are output into
-``build/libcxx/test/benchmarks``.
+The benchmarks are located under ``libcxx/test/benchmarks``. Running a benchmark
+works in the same way as running a test. Both the benchmarks and the tests share
+the same configuration, so make sure to enable the relevant optimization level
+when running the benchmarks.
----------------
ldionne wrote:

I feel you, but it still seems like the right thing to do. We want to be able to run the benchmarks under arbitrary optimization levels so we can e.g. evaluate the performance of an algorithm when optimizations are disabled. This calls for not hardcoding any optimization level when running the benchmarks, just like we don't when we run the tests.

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


More information about the libcxx-commits mailing list