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

Function BM_RleDecodingBoolean

cpp/src/parquet/encoding_benchmark.cc:1029–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1027BENCHMARK(BM_RleEncodingBoolean)->Range(MIN_RANGE, MAX_RANGE);
1028
1029static void BM_RleDecodingBoolean(benchmark::State& state) {
1030 std::vector<bool> values(state.range(0), true);
1031 bool* output = new bool[state.range(0)];
1032 auto encoder = MakeEncoder(Type::BOOLEAN, Encoding::RLE);
1033 auto typed_encoder = dynamic_cast<BooleanEncoder*>(encoder.get());
1034 typed_encoder->Put(values, static_cast<int>(values.size()));
1035 std::shared_ptr<Buffer> buf = encoder->FlushValues();
1036
1037 auto decoder = MakeTypedDecoder<BooleanType>(Encoding::RLE);
1038 for (auto _ : state) {
1039 decoder->SetData(static_cast<int>(values.size()), buf->data(),
1040 static_cast<int>(buf->size()));
1041 decoder->Decode(output, static_cast<int>(values.size()));
1042 }
1043
1044 state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(bool));
1045 delete[] output;
1046}
1047
1048BENCHMARK(BM_RleDecodingBoolean)->Range(MIN_RANGE, MAX_RANGE);
1049

Callers

nothing calls this directly

Calls 8

MakeEncoderFunction · 0.70
getMethod · 0.45
PutMethod · 0.45
sizeMethod · 0.45
FlushValuesMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
DecodeMethod · 0.45

Tested by

no test coverage detected