MCPcopy Create free account
hub / github.com/apache/arrow / BM_DictDecodingByteArray

Function BM_DictDecodingByteArray

cpp/src/parquet/encoding_benchmark.cc:1168–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166BENCHMARK(BM_DictEncodingInt64_literals)->Range(MIN_RANGE, MAX_RANGE);
1167
1168static 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
1189BENCHMARK(BM_DictDecodingByteArray)->Apply(ByteArrayCustomArguments);
1190

Callers

nothing calls this directly

Calls 7

emplace_backMethod · 0.80
value_offsetsMethod · 0.80
StringMethod · 0.45
lengthMethod · 0.45
GetViewMethod · 0.45
sizeMethod · 0.45
value_dataMethod · 0.45

Tested by

no test coverage detected