MCPcopy Create free account
hub / github.com/apache/arrow / BenchmarkTrieLookups

Function BenchmarkTrieLookups

cpp/src/arrow/util/trie_benchmark.cc:60–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static void BenchmarkTrieLookups(benchmark::State& state, // NOLINT non-const reference
61 const std::vector<std::string>& strings) {
62 Trie trie = MakeNullsTrie();
63 int32_t total = 0;
64
65 auto lookups = Expand(strings, 100);
66
67 for (auto _ : state) {
68 for (const auto& s : lookups) {
69 total += trie.Find(s);
70 }
71 }
72 benchmark::DoNotOptimize(total);
73 state.SetItemsProcessed(state.iterations() * lookups.size());
74}
75
76static void TrieLookupFound(benchmark::State& state) { // NOLINT non-const reference
77 BenchmarkTrieLookups(state, {"N/A", "null", "-1.#IND", "N/A"});

Callers 2

TrieLookupFoundFunction · 0.85
TrieLookupNotFoundFunction · 0.85

Calls 4

MakeNullsTrieFunction · 0.85
ExpandFunction · 0.85
FindMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected