Commit 52495da0 by Evan Brown Committed by Copybara-Service

Add CodegenAbslRawHashSetStringFindNeEnd function, which is useful because the…

Add CodegenAbslRawHashSetStringFindNeEnd function, which is useful because the find isn't inlined but the iterator comparison is.

PiperOrigin-RevId: 503473637
Change-Id: I02b8d95b7a1b738314c4f07a863c7606f822f079
parent a0b102c3
......@@ -16,6 +16,7 @@
#include <cmath>
#include <numeric>
#include <random>
#include <tuple>
#include <utility>
#include <vector>
......@@ -512,6 +513,12 @@ bool CodegenAbslRawHashSetInt64FindNeEnd(
return table->find(key) != table->end();
}
// This is useful because the find isn't inlined but the iterator comparison is.
bool CodegenAbslRawHashSetStringFindNeEnd(
absl::container_internal::StringTable* table, const std::string& key) {
return table->find(key) != table->end();
}
auto CodegenAbslRawHashSetInt64Insert(absl::container_internal::IntTable* table,
int64_t key)
-> decltype(table->insert(key)) {
......@@ -531,6 +538,7 @@ void CodegenAbslRawHashSetInt64Iterate(
int odr =
(::benchmark::DoNotOptimize(std::make_tuple(
&CodegenAbslRawHashSetInt64Find, &CodegenAbslRawHashSetInt64FindNeEnd,
&CodegenAbslRawHashSetStringFindNeEnd,
&CodegenAbslRawHashSetInt64Insert, &CodegenAbslRawHashSetInt64Contains,
&CodegenAbslRawHashSetInt64Iterate)),
1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment