| 1027 | BENCHMARK(BM_RleEncodingBoolean)->Range(MIN_RANGE, MAX_RANGE); |
| 1028 | |
| 1029 | static void BM_RleDecodingBoolean(benchmark::State& state) { |
| 1030 | std::vector<bool> values(state.range(0), true); |
| 1031 | bool* output = new bool[state.range(0)]; |
| 1032 | auto encoder = MakeEncoder(Type::BOOLEAN, Encoding::RLE); |
| 1033 | auto typed_encoder = dynamic_cast<BooleanEncoder*>(encoder.get()); |
| 1034 | typed_encoder->Put(values, static_cast<int>(values.size())); |
| 1035 | std::shared_ptr<Buffer> buf = encoder->FlushValues(); |
| 1036 | |
| 1037 | auto decoder = MakeTypedDecoder<BooleanType>(Encoding::RLE); |
| 1038 | for (auto _ : state) { |
| 1039 | decoder->SetData(static_cast<int>(values.size()), buf->data(), |
| 1040 | static_cast<int>(buf->size())); |
| 1041 | decoder->Decode(output, static_cast<int>(values.size())); |
| 1042 | } |
| 1043 | |
| 1044 | state.SetBytesProcessed(state.iterations() * state.range(0) * sizeof(bool)); |
| 1045 | delete[] output; |
| 1046 | } |
| 1047 | |
| 1048 | BENCHMARK(BM_RleDecodingBoolean)->Range(MIN_RANGE, MAX_RANGE); |
| 1049 |
nothing calls this directly
no test coverage detected