-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compressor filter: add benchmark #10464
compressor filter: add benchmark #10464
Conversation
I am debugging a case of slow responses possibly due to compression, so throwing in some benchmarks to get some perf data about this filter. ``` $ ./bazel-bin/test/extensions/filters/http/common/compressor/compressor_filter_speed_test 2020-03-20 00:15:07 Running ./bazel-bin/test/extensions/filters/http/common/compressor/compressor_filter_speed_test Run on (8 X 2300 MHz CPU s) CPU Caches: L1 Data 32K (x4) L1 Instruction 32K (x4) L2 Unified 262K (x4) L3 Unified 6291K (x1) Load Average: 2.17, 2.14, 2.00 ***WARNING*** Library was built as DEBUG. Timings may be affected. --------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------- FilterCompress 24674140 ns 24616586 ns 29 ``` Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Thanks! This looks good to me. BTW, what kind of slowness you're debugging? Bad latency or throughput? |
Latency -- with big responses (> 100kb)... |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
/retest |
🔨 rebuilding |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Turns out, instantiating this Mock takes ~6ms (!!). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
This brings time down to < 5ms (way better!). Turns we were using a lot of time calling TestUtility::feedBufferWithRandomCharacters(). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Once #10508 lands, I'll update this to exercise different chunk sizes. We can still land this as is, and I'll do a follow-up -- no need to wait. |
test/extensions/filters/http/common/compressor/compressor_filter_speed_test.cc
Outdated
Show resolved
Hide resolved
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
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>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
This actually makes the difference between different chunk size mostly dissapear. I suspect the previous differences were due to chunks being the same, since the seed for the random data isn't changing. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
@dio PTAL. |
ping? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good to me.
Signed-off-by: Spencer Lewis <slewis@squareup.com> * master: fault injection: add support for setting gRPC status (envoyproxy#10841) tests: tag tests that fail on Windows with fails_on_windows (envoyproxy#10940) Fix typo on Postgres Proxy documentation. (envoyproxy#10930) fuzz: improve header/data stop/continue modeling in HCM fuzzer. (envoyproxy#10931) gzip filter: allow setting zlib compressor's chunk size (envoyproxy#10508) http: replace vector/reserve with InlinedVector in codec helper (envoyproxy#10941) stats: add utilities to create stats from a vector of tokens, mixing dynamic and symbolic elements. (envoyproxy#10735) hcm: avoid invoking 100-continue handling on decode filter. (envoyproxy#10929) prometheus stats: Correctly group lines of the same metric name. (envoyproxy#10833) status: Fix ASAN error in Status payload handling (envoyproxy#10906) path: Fix merge slash for paths ending with slash and present query args (envoyproxy#10922) compressor filter: add benchmark (envoyproxy#10464) xray: expected_span_name is not captured by the lambda with MSVC (envoyproxy#10934) ci: update before purge in cleanup (envoyproxy#10938) tracer: Improve test coverage for x-ray (envoyproxy#10890) Revert "init: order dynamic resource initialization to make RTDS always be first (envoyproxy#10362)" (envoyproxy#10919)
I am debugging a case of slow responses possibly due to compression, so
throwing in some benchmarks to get some perf data about this filter.
Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com