[libcxx-commits] [libcxx] [libc++] Drop char8_t instantiation from string benchmarks (PR #212283)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 27 08:52:44 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

The string benchmarks instantiated every benchmark for char, char8_t and wchar_t. char8_t exercises the same code paths as char, so drop it to get roughly a 30% speedup on this benchmark time.

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


1 Files Affected:

- (modified) libcxx/test/benchmarks/containers/string.bench.cpp (-4) 


``````````diff
diff --git a/libcxx/test/benchmarks/containers/string.bench.cpp b/libcxx/test/benchmarks/containers/string.bench.cpp
index 776ee5f58b7e2..26e2f62ad57fe 100644
--- a/libcxx/test/benchmarks/containers/string.bench.cpp
+++ b/libcxx/test/benchmarks/containers/string.bench.cpp
@@ -36,10 +36,6 @@ void bench(std::string name, Func func, Mod modifier = {}) {
     func(std::type_identity<char>(), state);
   })->Apply(modifier);
 
-  benchmark::RegisterBenchmark(rename(name, "u8string"), [=](benchmark::State& state) {
-    func(std::type_identity<char8_t>(), state);
-  })->Apply(modifier);
-
 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
   benchmark::RegisterBenchmark(rename(name, "wstring"), [=](benchmark::State& state) {
     func(std::type_identity<wchar_t>(), state);

``````````

</details>


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


More information about the libcxx-commits mailing list