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

Class Callable

cpp/src/arrow/util/cache_benchmark.cc:91–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89BENCHMARK(LruCacheLookup)->Apply(SetCacheArgs);
90
91struct Callable {
92 explicit Callable(std::vector<std::string> values)
93 : index_(0), values_(std::move(values)) {}
94
95 std::string operator()(const std::string& key) {
96 // Return a value unrelated to the key
97 if (++index_ >= static_cast<int64_t>(values_.size())) {
98 index_ = 0;
99 }
100 return values_[index_];
101 }
102
103 private:
104 int64_t index_;
105 std::vector<std::string> values_;
106};
107
108template <typename Memoized>
109static void BenchmarkMemoize(benchmark::State& state, Memoized&& mem,

Callers 2

MemoizeLruCachedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected