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

Function BM_PlainDecodingBoolean

cpp/src/parquet/encoding_benchmark.cc:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73BENCHMARK(BM_PlainEncodingBoolean)->Range(MIN_RANGE, MAX_RANGE);
74
75static void BM_PlainDecodingBoolean(benchmark::State& state) {
76 std::vector<bool> values(state.range(0), true);
77 bool* output = new bool[state.range(0)];
78 auto encoder = MakeEncoder(Type::BOOLEAN, Encoding::PLAIN);
79 auto typed_encoder = dynamic_cast<BooleanEncoder*>(encoder.get());
80 typed_encoder->Put(values, static_cast<int>(values.size()));
81 std::shared_ptr<Buffer> buf = encoder->FlushValues();
82
83 for (auto _ : state) {
84 auto decoder = MakeTypedDecoder<BooleanType>(Encoding::PLAIN);
85 decoder->SetData(static_cast<int>(values.size()), buf->data(),
86 static_cast<int>(buf->size()));
87 decoder->Decode(output, static_cast<int>(values.size()));
88 }
89
90 state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(bool));
91 state.SetItemsProcessed(state.iterations() * state.range(0));
92 delete[] output;
93}
94
95BENCHMARK(BM_PlainDecodingBoolean)->Range(MIN_RANGE, MAX_RANGE);
96

Callers

nothing calls this directly

Calls 8

MakeEncoderFunction · 0.85
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