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

Function BuildDecimalArray

cpp/src/arrow/builder_benchmark.cc:230–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230static void BuildDecimalArray(benchmark::State& state) { // NOLINT non-const reference
231 auto type = decimal128(10, 5);
232 Decimal128 value;
233 int32_t precision = 0;
234 int32_t scale = 0;
235 ABORT_NOT_OK(Decimal128::FromString("1234.1234", &value, &precision, &scale));
236 for (auto _ : state) {
237 Decimal128Builder builder(type, memory_tracker.memory_pool());
238
239 for (int64_t i = 0; i < kRounds * kNumberOfElements; i++) {
240 ABORT_NOT_OK(builder.Append(value));
241 }
242
243 std::shared_ptr<Array> out;
244 ABORT_NOT_OK(builder.Finish(&out));
245 }
246
247 state.SetBytesProcessed(state.iterations() * kRounds * kNumberOfElements * 16);
248 state.SetItemsProcessed(state.iterations() * kRounds * kNumberOfElements);
249}
250
251// ----------------------------------------------------------------------
252// DictionaryBuilder benchmarks

Callers

nothing calls this directly

Calls 5

FromStringFunction · 0.85
decimal128Function · 0.70
memory_poolMethod · 0.45
AppendMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected