[libcxx-commits] [libcxx] [libcxx] Avoid hash key in __hash_table::find() if it is empty. (PR #126837)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 17 19:33:18 PDT 2025


================
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
----------------
xbcnn wrote:

The `Arg(0)` does cover `empty` container case, but not `expensive` key scenario, because both `with_existent_key` and `with_nonexistent_key` use random keys (especially for `std::string` keys with random sizes). To better demonstrate the differences, we should add a dedicated `expensive` key case.

How about keeping `Arg(0)` (which remains useful for other benchmarks) and adding `with_expensive_key_empty` for cases here?


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


More information about the libcxx-commits mailing list