| 78 | |
| 79 | template <typename T> |
| 80 | void benchmarkComputeValueIds(bool withNulls) { |
| 81 | folly::BenchmarkSuspender suspender; |
| 82 | vector_size_t size = 1'000; |
| 83 | BenchmarkBase base; |
| 84 | VectorHasher hasher(CppToType<T>::create(), 0); |
| 85 | auto values = base.vectorMaker().flatVector<T>( |
| 86 | size, |
| 87 | [](vector_size_t row) { return row % 17; }, |
| 88 | withNulls ? test::VectorMaker::nullEvery(7) : nullptr); |
| 89 | |
| 90 | raw_vector<uint64_t> hashes(size); |
| 91 | SelectivityVector rows(size); |
| 92 | hasher.decode(*values, rows); |
| 93 | hasher.computeValueIds(rows, hashes); |
| 94 | hasher.enableValueRange(1, 0); |
| 95 | suspender.dismiss(); |
| 96 | |
| 97 | for (int i = 0; i < 10'000; i++) { |
| 98 | hasher.decode(*values, rows); |
| 99 | bool ok = hasher.computeValueIds(rows, hashes); |
| 100 | folly::doNotOptimizeAway(ok); |
| 101 | } |
| 102 | } |
| 103 | } // namespace |
| 104 | |
| 105 | // Uses SIMD acceleration |
nothing calls this directly
no test coverage detected