[libcxx-commits] [PATCH] D128021: [libc++] Don't call key_eq in unordered_map/set rehashing routine
Ivan via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jun 17 17:59:11 PDT 2022
itrofimow added inline comments.
================
Comment at: libcxx/benchmarks/unordered_set_operations.bench.cpp:311
+ getRandomStringInputs)->Arg(TestNumInputs);
+
BENCHMARK_MAIN();
----------------
This is with the patch:
BM_Rehash/unordered_set_string_arg/1024 44848 ns 44846 ns 96172
This is on trunk:
BM_Rehash/unordered_set_string_arg/1024 55711 ns 55706 ns 74198
full output: https://pastebin.com/7DMcNTna
This benchmark doesn't mean there is an immense speedup in rehashing, it just shows that there is a speedup - `max_load_factor(3)` was used to be sure that there will be collisions and key_eq branch in rehashing would be hit. So this just measures how long it takes to compare long random strings, but with the patch we don't compare them at all.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128021/new/
https://reviews.llvm.org/D128021
More information about the libcxx-commits
mailing list