zlib: use Z_DEFAULT_STRATEGY by default instead of Z_FIXED#10676
Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom Apr 8, 2020
Merged
zlib: use Z_DEFAULT_STRATEGY by default instead of Z_FIXED#10676mattklein123 merged 3 commits intoenvoyproxy:masterfrom
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
Conversation
Since Envoy::Compressor::ZlibCompressorImpl::CompressionStrategy is simply static_cast'ed to uint64_t the Standard strategy (4) becomes Z_FIXED (4 as well). This basically disables the use of dynamic Huffman codes when the gzip filter is configured to use default values. Make the Standard strategy equal to 0 to translate to Z_DEFAULT_STRATEGY. Contributes to envoyproxy#8448 Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Member
Author
|
/cc @rgs1 |
Member
|
Nice, this doesn't make my benchmarks go faster but it does compress a bit better. |
mattklein123
requested changes
Apr 7, 2020
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, small comment.
/wait
| Huffman = 2, | ||
| Rle = 3, | ||
| Standard = 4, | ||
| Standard = 0, |
Member
There was a problem hiding this comment.
Please add a comment on why this is done this way. Also, does this need a release note?
Member
Author
There was a problem hiding this comment.
I put the defines from zlib.h instead of magic numbers. I think they are self-descriptive enough.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
mattklein123
reviewed
Apr 8, 2020
| circuit breaker behavior is described :ref:`here <arch_overview_circuit_break>`. | ||
| * upstream: changed load distribution algorithm when all priorities enter :ref:`panic mode<arch_overview_load_balancing_panic_threshold>`. | ||
| * zlib: by default zlib is initialized to use its default strategy (Z_DEFAULT_STRATEGY) | ||
| instead of the fixed one (Z_FIXED). The difference is that the use of dynammic |
Member
There was a problem hiding this comment.
note to self: typo "dynammic". I will fix this when I do the release cleanup.
mattklein123
approved these changes
Apr 8, 2020
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, let's take this for 1.14.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Since
Envoy::Compressor::ZlibCompressorImpl::CompressionStrategyis simply static_cast'ed touint64_ttheStandardstrategy (4) becomesZ_FIXED(4 as well). This basically disables the use ofdynamic Huffman codes when the gzip filter is configured to use default values.
Make the
Standardstrategy equal to 0 to translate toZ_DEFAULT_STRATEGY.Contributes to #8448
Risk Level: Low
Testing: Manual testing