| 54 | } |
| 55 | |
| 56 | static void FromString(benchmark::State& state) { // NOLINT non-const reference |
| 57 | const std::vector<std::string>& values = GetValuesAsString(); |
| 58 | for (auto _ : state) { |
| 59 | for (const auto& value : values) { |
| 60 | Decimal128 dec; |
| 61 | int32_t scale, precision; |
| 62 | auto status = Decimal128::FromString(value, &dec, &scale, &precision); |
| 63 | benchmark::DoNotOptimize(status); |
| 64 | } |
| 65 | } |
| 66 | state.SetItemsProcessed(state.iterations() * values.size()); |
| 67 | } |
| 68 | |
| 69 | static void ToString(benchmark::State& state) { // NOLINT non-const reference |
| 70 | static const std::vector<DecimalValueAndScale> values = GetDecimalValuesAndScales(); |