| 170 | BENCHMARK(BM_PlainEncodingDoubleNaN)->Range(MIN_RANGE, MAX_RANGE); |
| 171 | |
| 172 | static void BM_PlainDecodingDouble(benchmark::State& state) { |
| 173 | std::vector<double> values(state.range(0), 64.0); |
| 174 | auto encoder = MakeTypedEncoder<DoubleType>(Encoding::PLAIN); |
| 175 | encoder->Put(values.data(), static_cast<int>(values.size())); |
| 176 | std::shared_ptr<Buffer> buf = encoder->FlushValues(); |
| 177 | |
| 178 | for (auto _ : state) { |
| 179 | auto decoder = MakeTypedDecoder<DoubleType>(Encoding::PLAIN); |
| 180 | decoder->SetData(static_cast<int>(values.size()), buf->data(), |
| 181 | static_cast<int>(buf->size())); |
| 182 | decoder->Decode(values.data(), static_cast<int>(values.size())); |
| 183 | } |
| 184 | state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(double)); |
| 185 | } |
| 186 | |
| 187 | BENCHMARK(BM_PlainDecodingDouble)->Range(MIN_RANGE, MAX_RANGE); |
| 188 | |