| 1166 | BENCHMARK(BM_DictEncodingInt64_literals)->Range(MIN_RANGE, MAX_RANGE); |
| 1167 | |
| 1168 | static void BM_DictDecodingByteArray(benchmark::State& state) { |
| 1169 | ::arrow::random::RandomArrayGenerator rag(0); |
| 1170 | // Using arrow generator to generate random data. |
| 1171 | int32_t max_length = static_cast<int32_t>(state.range(0)); |
| 1172 | int32_t array_size = static_cast<int32_t>(state.range(1)); |
| 1173 | auto array = |
| 1174 | rag.String(/* size */ array_size, /* min_length */ 0, /* max_length */ max_length, |
| 1175 | /* null_probability */ 0); |
| 1176 | const auto array_actual = |
| 1177 | ::arrow::internal::checked_pointer_cast<::arrow::StringArray>(array); |
| 1178 | auto encoder = MakeDictDecoder<ByteArrayType>(); |
| 1179 | std::vector<ByteArray> values; |
| 1180 | for (int i = 0; i < array_actual->length(); ++i) { |
| 1181 | values.emplace_back(array_actual->GetView(i)); |
| 1182 | } |
| 1183 | DecodeDict<ByteArrayType>(values, state); |
| 1184 | state.SetItemsProcessed(state.iterations() * array_actual->length()); |
| 1185 | state.SetBytesProcessed(state.iterations() * (array_actual->value_data()->size() + |
| 1186 | array_actual->value_offsets()->size())); |
| 1187 | } |
| 1188 | |
| 1189 | BENCHMARK(BM_DictDecodingByteArray)->Apply(ByteArrayCustomArguments); |
| 1190 |
nothing calls this directly
no test coverage detected