| 73 | BENCHMARK(BM_PlainEncodingBoolean)->Range(MIN_RANGE, MAX_RANGE); |
| 74 | |
| 75 | static void BM_PlainDecodingBoolean(benchmark::State& state) { |
| 76 | std::vector<bool> values(state.range(0), true); |
| 77 | bool* output = new bool[state.range(0)]; |
| 78 | auto encoder = MakeEncoder(Type::BOOLEAN, Encoding::PLAIN); |
| 79 | auto typed_encoder = dynamic_cast<BooleanEncoder*>(encoder.get()); |
| 80 | typed_encoder->Put(values, static_cast<int>(values.size())); |
| 81 | std::shared_ptr<Buffer> buf = encoder->FlushValues(); |
| 82 | |
| 83 | for (auto _ : state) { |
| 84 | auto decoder = MakeTypedDecoder<BooleanType>(Encoding::PLAIN); |
| 85 | decoder->SetData(static_cast<int>(values.size()), buf->data(), |
| 86 | static_cast<int>(buf->size())); |
| 87 | decoder->Decode(output, static_cast<int>(values.size())); |
| 88 | } |
| 89 | |
| 90 | state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(bool)); |
| 91 | state.SetItemsProcessed(state.iterations() * state.range(0)); |
| 92 | delete[] output; |
| 93 | } |
| 94 | |
| 95 | BENCHMARK(BM_PlainDecodingBoolean)->Range(MIN_RANGE, MAX_RANGE); |
| 96 |
nothing calls this directly
no test coverage detected