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

Function Compress

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

Source from the content-addressed store, hash-verified

134}
135
136int64_t Compress(Codec* codec, const std::vector<uint8_t>& data,
137 std::vector<uint8_t>* compressed_data) {
138 const uint8_t* input = data.data();
139 int64_t input_len = data.size();
140 int64_t compressed_size = 0;
141 int64_t max_compressed_len = codec->MaxCompressedLen(input_len, input);
142 compressed_data->resize(max_compressed_len);
143
144 if (input_len > 0) {
145 compressed_size = *codec->Compress(input_len, input, compressed_data->size(),
146 compressed_data->data());
147 compressed_data->resize(compressed_size);
148 }
149 return compressed_size;
150}
151
152template <Compression::type COMPRESSION>
153static void ReferenceCompression(benchmark::State& state) { // NOLINT non-const reference

Callers 2

ReferenceCompressionFunction · 0.70
ReferenceDecompressionFunction · 0.70

Calls 5

resizeMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
MaxCompressedLenMethod · 0.45
CompressMethod · 0.45

Tested by

no test coverage detected