| 34 | constexpr auto kSeed = 0x94378165; |
| 35 | |
| 36 | static void BenchmarkArrayRangeEquals(const std::shared_ptr<Array>& array, |
| 37 | benchmark::State& state) { |
| 38 | const auto left_array = array; |
| 39 | // Make sure pointer equality can't be used as a shortcut |
| 40 | // (should we would deep-copy child_data and buffers?) |
| 41 | const auto right_array = |
| 42 | MakeArray(array->data()->Copy())->Slice(1, array->length() - 1); |
| 43 | |
| 44 | for (auto _ : state) { |
| 45 | const bool are_ok = ArrayRangeEquals(*left_array, *right_array, |
| 46 | /*left_start_idx=*/1, |
| 47 | /*left_end_idx=*/array->length() - 2, |
| 48 | /*right_start_idx=*/0); |
| 49 | if (ARROW_PREDICT_FALSE(!are_ok)) { |
| 50 | ARROW_LOG(FATAL) << "Arrays should have compared equal"; |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | static void ArrayRangeEqualsInt32(benchmark::State& state) { |
| 56 | RegressionArgs args(state, /*size_is_bytes=*/false); |
no test coverage detected