| 113 | } |
| 114 | |
| 115 | static void StreamingCompression(Compression::type compression, |
| 116 | const std::vector<uint8_t>& data, |
| 117 | benchmark::State& state) { // NOLINT non-const reference |
| 118 | auto codec = *Codec::Create(compression); |
| 119 | |
| 120 | while (state.KeepRunning()) { |
| 121 | int64_t compressed_size = StreamingCompress(codec.get(), data); |
| 122 | state.counters["ratio"] = |
| 123 | static_cast<double>(data.size()) / static_cast<double>(compressed_size); |
| 124 | } |
| 125 | state.SetBytesProcessed(state.iterations() * data.size()); |
| 126 | } |
| 127 | |
| 128 | template <Compression::type COMPRESSION> |
| 129 | static void ReferenceStreamingCompression( |
no test coverage detected