summaryrefslogtreecommitdiff
path: root/absl/container/internal/raw_hash_set_benchmark.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/container/internal/raw_hash_set_benchmark.cc')
-rw-r--r--absl/container/internal/raw_hash_set_benchmark.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/absl/container/internal/raw_hash_set_benchmark.cc b/absl/container/internal/raw_hash_set_benchmark.cc
index bc8184d4..8cd43fb5 100644
--- a/absl/container/internal/raw_hash_set_benchmark.cc
+++ b/absl/container/internal/raw_hash_set_benchmark.cc
@@ -479,6 +479,17 @@ void BM_Group_MaskEmptyOrDeleted(benchmark::State& state) {
}
BENCHMARK(BM_Group_MaskEmptyOrDeleted);
+void BM_Group_MaskNonFull(benchmark::State& state) {
+ std::array<ctrl_t, Group::kWidth> group;
+ Iota(group.begin(), group.end(), -4);
+ Group g{group.data()};
+ for (auto _ : state) {
+ ::benchmark::DoNotOptimize(g);
+ ::benchmark::DoNotOptimize(g.MaskNonFull());
+ }
+}
+BENCHMARK(BM_Group_MaskNonFull);
+
void BM_Group_CountLeadingEmptyOrDeleted(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
Iota(group.begin(), group.end(), -2);
@@ -501,6 +512,17 @@ void BM_Group_MatchFirstEmptyOrDeleted(benchmark::State& state) {
}
BENCHMARK(BM_Group_MatchFirstEmptyOrDeleted);
+void BM_Group_MatchFirstNonFull(benchmark::State& state) {
+ std::array<ctrl_t, Group::kWidth> group;
+ Iota(group.begin(), group.end(), -2);
+ Group g{group.data()};
+ for (auto _ : state) {
+ ::benchmark::DoNotOptimize(g);
+ ::benchmark::DoNotOptimize(g.MaskNonFull().LowestBitSet());
+ }
+}
+BENCHMARK(BM_Group_MatchFirstNonFull);
+
void BM_DropDeletes(benchmark::State& state) {
constexpr size_t capacity = (1 << 20) - 1;
std::vector<ctrl_t> ctrl(capacity + 1 + Group::kWidth);