| 129 | BENCHMARK(BM_PlainEncodingInt64)->Range(MIN_RANGE, MAX_RANGE); |
| 130 | |
| 131 | static void BM_PlainDecodingInt64(benchmark::State& state) { |
| 132 | std::vector<int64_t> values(state.range(0), 64); |
| 133 | auto encoder = MakeTypedEncoder<Int64Type>(Encoding::PLAIN); |
| 134 | encoder->Put(values.data(), static_cast<int>(values.size())); |
| 135 | std::shared_ptr<Buffer> buf = encoder->FlushValues(); |
| 136 | |
| 137 | for (auto _ : state) { |
| 138 | auto decoder = MakeTypedDecoder<Int64Type>(Encoding::PLAIN); |
| 139 | decoder->SetData(static_cast<int>(values.size()), buf->data(), |
| 140 | static_cast<int>(buf->size())); |
| 141 | decoder->Decode(values.data(), static_cast<int>(values.size())); |
| 142 | } |
| 143 | state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(int64_t)); |
| 144 | } |
| 145 | |
| 146 | BENCHMARK(BM_PlainDecodingInt64)->Range(MIN_RANGE, MAX_RANGE); |
| 147 | |