From 7c8911d32bc9f0550c36a6434b030396a4057423 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Sat, 14 Jun 2025 20:09:53 +0300 Subject: [PATCH 1/3] Expand bemchmarking examples --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 922d91a706..166cdba74e 100644 --- a/README.md +++ b/README.md @@ -474,6 +474,25 @@ If you want to see all the other flags you can pass, run: out\bench\benchmark- --help ``` +## Other useful incantations + +To compile benchmark with some additional compiler options, use `_CL_` environment variable. +You'll need to clean to make sure you obtain new binaries instead of the old ones. +For example, here's how to add `/arch:AVX2` option (which may affect auto vectorization and bit algoritms intrinsics): + +``` +set _CL_=/arch:AVX2 +cmake --build out\bench --clean-first +``` + +To compile with clang-cl you need to pass `-DCMAKE_CXX_COMPILER=clang-cl` option: + +``` +cmake -B out\bench -S benchmarks -G Ninja -DSTL_BINARY_DIR=out\x64 -DCMAKE_CXX_COMPILER=clang-cl +cmake --build out\bench +``` + + # Editing And Testing The Debugger Visualizer ### Modify The Visualizer From 79842a84c2a27409196266cfac03d9e32e26d00c Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Wed, 2 Jul 2025 18:07:03 +0300 Subject: [PATCH 2/3] also add affinity --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 166cdba74e..0ac2d2cb63 100644 --- a/README.md +++ b/README.md @@ -492,6 +492,12 @@ cmake -B out\bench -S benchmarks -G Ninja -DSTL_BINARY_DIR=out\x64 -DCMAKE_CXX_C cmake --build out\bench ``` +To run a benchmark on specific cores (for example to run on P cores or on E cores) and with higher priority +(to avoid interference), use `start` command with parameters: + +``` +start /b /wait /high /affinity 0F out\bench\benchmark-std_copy +``` # Editing And Testing The Debugger Visualizer From b787395104f975db999041894ac4548e7bb77ed0 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 17 Sep 2025 15:23:26 -0700 Subject: [PATCH 3/3] Code review feedback. --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7c74772f0e..38a8c64db9 100644 --- a/README.md +++ b/README.md @@ -469,26 +469,27 @@ If you want to see all the other flags you can pass, run: out\bench\benchmark- --help ``` -## Other useful incantations +## Other Useful Incantations -To compile benchmark with some additional compiler options, use `_CL_` environment variable. -You'll need to clean to make sure you obtain new binaries instead of the old ones. -For example, here's how to add `/arch:AVX2` option (which may affect auto vectorization and bit algoritms intrinsics): +To compile the benchmarks with additional compiler options, use the [`CXXFLAGS` environment variable][CXXFLAGS]. +Set it after configuring and building the STL, but before configuring and building the benchmarks. +For example, to examine how the `/arch:AVX2` option affects auto-vectorization and bit algorithm intrinsics: ``` -set _CL_=/arch:AVX2 -cmake --build out\bench --clean-first +set CXXFLAGS=/arch:AVX2 +cmake -B out\bench -S benchmarks -G Ninja -DSTL_BINARY_DIR=out\x64 +cmake --build out\bench ``` -To compile with clang-cl you need to pass `-DCMAKE_CXX_COMPILER=clang-cl` option: +To compile the benchmarks with Clang, use `-DCMAKE_CXX_COMPILER=clang-cl`: ``` cmake -B out\bench -S benchmarks -G Ninja -DSTL_BINARY_DIR=out\x64 -DCMAKE_CXX_COMPILER=clang-cl cmake --build out\bench ``` -To run a benchmark on specific cores (for example to run on P cores or on E cores) and with higher priority -(to avoid interference), use `start` command with parameters: +To run a benchmark on specific cores (e.g. P-cores vs. E-cores) and with higher priority +(to avoid interference), use the [`start` command][start-command]: ``` start /b /wait /high /affinity 0F out\bench\benchmark-std_copy @@ -606,3 +607,5 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ASan]: https://learn.microsoft.com/en-us/cpp/sanitizers/asan [Import Library]: /docs/import_library.md [VS 2026 Insiders]: https://visualstudio.microsoft.com/insiders/ +[CXXFLAGS]: https://cmake.org/cmake/help/latest/envvar/CXXFLAGS.html +[start-command]: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start