| 211 | BENCHMARK(BM_PlainEncodingFloatNaN)->Range(MIN_RANGE, MAX_RANGE); |
| 212 | |
| 213 | static 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 | |
| 228 | BENCHMARK(BM_PlainDecodingFloat)->Range(MIN_RANGE, MAX_RANGE); |
| 229 | |