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

Function BinaryRepeat

cpp/src/arrow/compute/kernels/scalar_string_benchmark.cc:218–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static void BinaryRepeat(benchmark::State& state) {
219 const int64_t array_length = 1 << 20;
220 const int64_t value_min_size = 0;
221 const int64_t value_max_size = 32;
222 const double null_probability = 0.01;
223 const int64_t repeat_min_size = 0;
224 const int64_t repeat_max_size = 8;
225 random::RandomArrayGenerator rng(kSeed);
226
227 // NOTE: this produces only-Ascii data
228 auto values =
229 rng.String(array_length, value_min_size, value_max_size, null_probability);
230 auto num_repeats = rng.Int64(array_length, repeat_min_size, repeat_max_size, 0);
231 // Make sure lookup tables are initialized before measuring
232 ABORT_NOT_OK(CallFunction("binary_repeat", {values, num_repeats}));
233
234 for (auto _ : state) {
235 ABORT_NOT_OK(CallFunction("binary_repeat", {values, num_repeats}));
236 }
237 state.SetItemsProcessed(state.iterations() * array_length);
238 state.SetBytesProcessed(state.iterations() * values->data()->buffers[2]->size());
239}
240
241BENCHMARK(AsciiLower);
242BENCHMARK(AsciiUpper);

Callers

nothing calls this directly

Calls 5

CallFunctionFunction · 0.85
StringMethod · 0.45
Int64Method · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected