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

Function ReferenceDecompression

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

Source from the content-addressed store, hash-verified

208
209template <Compression::type COMPRESSION>
210static void ReferenceDecompression(
211 benchmark::State& state) { // NOLINT non-const reference
212 auto data = MakeCompressibleData(8 * 1024 * 1024); // 8 MB
213
214 auto codec = *Codec::Create(COMPRESSION);
215
216 std::vector<uint8_t> compressed_data;
217 ARROW_UNUSED(Compress(codec.get(), data, &compressed_data));
218 state.counters["ratio"] =
219 static_cast<double>(data.size()) / static_cast<double>(compressed_data.size());
220
221 std::vector<uint8_t> decompressed_data(data);
222 while (state.KeepRunning()) {
223 auto result = codec->Decompress(compressed_data.size(), compressed_data.data(),
224 decompressed_data.size(), decompressed_data.data());
225 ARROW_CHECK(result.ok());
226 ARROW_CHECK(*result == static_cast<int64_t>(decompressed_data.size()));
227 }
228 state.SetBytesProcessed(state.iterations() * data.size());
229}
230
231# ifdef ARROW_WITH_ZLIB
232BENCHMARK_TEMPLATE(ReferenceStreamingCompression, Compression::GZIP);

Callers

nothing calls this directly

Calls 7

MakeCompressibleDataFunction · 0.70
CompressFunction · 0.70
getMethod · 0.45
sizeMethod · 0.45
DecompressMethod · 0.45
dataMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected