| 216 | } |
| 217 | |
| 218 | static 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 | |
| 241 | BENCHMARK(AsciiLower); |
| 242 | BENCHMARK(AsciiUpper); |
nothing calls this directly
no test coverage detected