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

Function BM_ByteStreamSplitDecode

cpp/src/parquet/encoding_benchmark.cc:407–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406template <typename T, typename DecodeFunc>
407static void BM_ByteStreamSplitDecode(benchmark::State& state, DecodeFunc&& decode_func) {
408 const std::vector<T> values(state.range(0), ByteStreamSplitDummyValue<T>::value());
409 const uint8_t* values_raw = reinterpret_cast<const uint8_t*>(values.data());
410 std::vector<T> output(state.range(0));
411
412 for (auto _ : state) {
413 decode_func(values_raw,
414 /*width=*/static_cast<int>(sizeof(T)),
415 /*num_values=*/static_cast<int64_t>(values.size()),
416 /*stride=*/static_cast<int64_t>(values.size()),
417 reinterpret_cast<uint8_t*>(output.data()));
418 benchmark::ClobberMemory();
419 }
420 state.SetBytesProcessed(state.iterations() * values.size() * sizeof(T));
421 state.SetItemsProcessed(state.iterations() * values.size());
422}
423
424template <typename T, typename EncodeFunc>
425static void BM_ByteStreamSplitEncode(benchmark::State& state, EncodeFunc&& encode_func) {

Callers

nothing calls this directly

Calls 3

valueFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected