| 228 | } |
| 229 | |
| 230 | static 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 |
nothing calls this directly
no test coverage detected