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

Function BM_PlainDecodingFloat

cpp/src/parquet/encoding_benchmark.cc:213–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211BENCHMARK(BM_PlainEncodingFloatNaN)->Range(MIN_RANGE, MAX_RANGE);
212
213static void BM_PlainDecodingFloat(benchmark::State& state) {
214 std::vector<float> values(state.range(0), 64.0);
215 auto encoder = MakeTypedEncoder<FloatType>(Encoding::PLAIN);
216 encoder->Put(values.data(), static_cast<int>(values.size()));
217 std::shared_ptr<Buffer> buf = encoder->FlushValues();
218
219 for (auto _ : state) {
220 auto decoder = MakeTypedDecoder<FloatType>(Encoding::PLAIN);
221 decoder->SetData(static_cast<int>(values.size()), buf->data(),
222 static_cast<int>(buf->size()));
223 decoder->Decode(values.data(), static_cast<int>(values.size()));
224 }
225 state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(float));
226}
227
228BENCHMARK(BM_PlainDecodingFloat)->Range(MIN_RANGE, MAX_RANGE);
229

Callers

nothing calls this directly

Calls 6

PutMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
FlushValuesMethod · 0.45
SetDataMethod · 0.45
DecodeMethod · 0.45

Tested by

no test coverage detected