Skip to content

Commit

Permalink
Add test for 16kb sized chunk
Browse files Browse the repository at this point in the history
Per:

https://github.com/envoyproxy/envoy/blob/master/source/common/network/raw_buffer_socket.cc#L21

Envoy reads 16kb at a time from upstream.

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
  • Loading branch information
Raul Gutierrez Segales committed Apr 7, 2020
1 parent 63c1bd2 commit 63f77b7
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ static std::vector<CompressionParams> compression_params = {
{Envoy::Compressor::ZlibCompressorImpl::CompressionLevel::Best,
Envoy::Compressor::ZlibCompressorImpl::CompressionStrategy::Standard, 15, 9}};

static void compressChunks16384(benchmark::State& state) {
NiceMock<Http::MockStreamDecoderFilterCallbacks> decoder_callbacks;
const auto idx = state.range(0);
const auto& params = compression_params[idx];

for (auto _ : state) {
std::vector<Buffer::OwnedImpl> chunks = generateChunks(7, 16384);
compressWith(std::move(chunks), params, decoder_callbacks);
}
}
BENCHMARK(compressChunks16384)->DenseRange(0, 8, 1);

static void compressChunks8192(benchmark::State& state) {
NiceMock<Http::MockStreamDecoderFilterCallbacks> decoder_callbacks;
const auto idx = state.range(0);
Expand Down

0 comments on commit 63f77b7

Please sign in to comment.