| 58 | } |
| 59 | |
| 60 | static 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 | |
| 76 | static void TrieLookupFound(benchmark::State& state) { // NOLINT non-const reference |
| 77 | BenchmarkTrieLookups(state, {"N/A", "null", "-1.#IND", "N/A"}); |
no test coverage detected