| 33 | namespace compute { |
| 34 | |
| 35 | static void BuildDictionary(benchmark::State& state) { // NOLINT non-const reference |
| 36 | const int64_t iterations = 1024; |
| 37 | |
| 38 | std::vector<int64_t> values; |
| 39 | std::vector<bool> is_valid; |
| 40 | for (int64_t i = 0; i < iterations; i++) { |
| 41 | for (int64_t j = 0; j < i; j++) { |
| 42 | is_valid.push_back((i + j) % 9 != 0); |
| 43 | values.push_back(j); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | std::shared_ptr<Array> arr; |
| 48 | ArrayFromVector<Int64Type, int64_t>(is_valid, values, &arr); |
| 49 | |
| 50 | while (state.KeepRunning()) { |
| 51 | ABORT_NOT_OK(DictionaryEncode(arr)); |
| 52 | } |
| 53 | state.counters["null_percent"] = |
| 54 | static_cast<double>(arr->null_count()) / arr->length() * 100; |
| 55 | state.SetBytesProcessed(state.iterations() * values.size() * sizeof(int64_t)); |
| 56 | state.SetItemsProcessed(state.iterations() * values.size()); |
| 57 | } |
| 58 | |
| 59 | static void BuildStringDictionary( |
| 60 | benchmark::State& state) { // NOLINT non-const reference |
nothing calls this directly
no test coverage detected