[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
Sun May 18 02:23:04 PDT 2025


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

OK.

It depends on the key type. For `int` keys, the difference is negligible, as expected. For `std::string` keys, current benchmarks use randomly generated strings of varying lengths, so results may vary between runs. However,  it should not be significant. And this optimization is quite straightforward, so I believe this is acceptable.

I'll update the benchmarks and results.

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


More information about the libcxx-commits mailing list