summaryrefslogtreecommitdiffstats
path: root/libcxx/benchmarks/unordered_set_operations.bench.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-24 06:22:25 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-24 06:22:25 +0000
commit1a06fe5f7ea47112a5e8ac6e0cc471ef96759591 (patch)
tree5cb3bb9ac19f0e535cf1590871de183847bc80df /libcxx/benchmarks/unordered_set_operations.bench.cpp
parent904a5d700752b19fec363f4bf8d00d5eef2c7efd (diff)
downloadbcm5719-llvm-1a06fe5f7ea47112a5e8ac6e0cc471ef96759591.tar.gz
bcm5719-llvm-1a06fe5f7ea47112a5e8ac6e0cc471ef96759591.zip
Skip chash computation in insert/emplace if the unconstrained hash matches.
llvm-svn: 276549
Diffstat (limited to 'libcxx/benchmarks/unordered_set_operations.bench.cpp')
-rw-r--r--libcxx/benchmarks/unordered_set_operations.bench.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/libcxx/benchmarks/unordered_set_operations.bench.cpp b/libcxx/benchmarks/unordered_set_operations.bench.cpp
index ab737c1ee7d..8c4463865d5 100644
--- a/libcxx/benchmarks/unordered_set_operations.bench.cpp
+++ b/libcxx/benchmarks/unordered_set_operations.bench.cpp
@@ -265,4 +265,42 @@ BENCHMARK_CAPTURE(BM_FindRehash,
std::unordered_set<std::string>{},
getRandomStringInputs)->Arg(TestNumInputs);
+///////////////////////////////////////////////////////////////////////////////
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string_insert_arg,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<unsigned>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string_arg,
+ std::unordered_set<std::string>{},
+ getRandomCStringInputs)->Arg(TestNumInputs);
+
BENCHMARK_MAIN()
OpenPOWER on IntegriCloud