| 151 | |
| 152 | template <Compression::type COMPRESSION> |
| 153 | static void ReferenceCompression(benchmark::State& state) { // NOLINT non-const reference |
| 154 | auto data = MakeCompressibleData(8 * 1024 * 1024); // 8 MB |
| 155 | |
| 156 | auto codec = *Codec::Create(COMPRESSION); |
| 157 | |
| 158 | while (state.KeepRunning()) { |
| 159 | std::vector<uint8_t> compressed_data; |
| 160 | auto compressed_size = Compress(codec.get(), data, &compressed_data); |
| 161 | state.counters["ratio"] = |
| 162 | static_cast<double>(data.size()) / static_cast<double>(compressed_size); |
| 163 | } |
| 164 | state.SetBytesProcessed(state.iterations() * data.size()); |
| 165 | } |
| 166 | |
| 167 | static void StreamingDecompression( |
| 168 | Compression::type compression, const std::vector<uint8_t>& data, |
nothing calls this directly
no test coverage detected