MCPcopy Create free account
hub / github.com/apache/arrow / ReferenceCompression

Function ReferenceCompression

cpp/src/arrow/util/compression_benchmark.cc:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152template <Compression::type COMPRESSION>
153static 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
167static void StreamingDecompression(
168 Compression::type compression, const std::vector<uint8_t>& data,

Callers

nothing calls this directly

Calls 4

MakeCompressibleDataFunction · 0.70
CompressFunction · 0.70
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected