Skip to content

Make the compression_level at settable option and expand it to zlib #540

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

rlerdorf
Copy link
Contributor

@rlerdorf rlerdorf commented May 3, 2023

Make it possible to use setOption to set Memcached::OPT_COMPRESSION_LEVEL which I had missed in my original zstd PR #539

zlib compression was using the default zlib compression level of 6. With this PR it is now possible to choose other levels for zlib as well. I have left the default at 6 so nothing will change for people upgrading unless they explicitly set a different level.

And here is some more bench marking data using php serialized data - https://gist.github.com/rlerdorf/b9bae385446d5a30b65e6e241e34d0a8

From this I think it is clear that fastlz is not really useful at any value size anymore. If you are looking for lightning quick compression and decompression, zstd at level 1 is generally a better choice.

I did not apply the compression_level to fastlz because it only has 2 and it currently switches from 1 to 2 automatically for values larger than 65535 bytes. Forcing it to one or the other doesn't seem useful.

@rlerdorf rlerdorf marked this pull request as ready for review May 3, 2023 18:33
@sodabrew sodabrew merged commit 7fefcb7 into php-memcached-dev:master May 3, 2023
@tylerchr tylerchr mentioned this pull request Dec 5, 2023
m6w6 added a commit that referenced this pull request Sep 26, 2024
- Add #515 option to locally enforce payload size limit
- Add #539 zstd support
- Add #540 compression_level option
- Mark password as a sensitive param for PHP 8.2
- Fix Windows PHP 8 compatibility
- Fix #518 Windows msgpack support
- Fix #522 signed integer overflow
- Fix #523 incorrect PHP reflection type for Memcached::cas $cas_token
- Fix #546 don't check key automatically, unless client-side verify_key is enabled
- Fix #555 incompatible pointer types (32-bit)
m6w6 added a commit that referenced this pull request Oct 4, 2024
    - Add #515 option to locally enforce payload size limit
    - Add #539 zstd support
    - Add #540 compression_level option
    - Mark password as a sensitive param for PHP 8.2
    - Fix Windows PHP 8 compatibility
    - Fix #518 Windows msgpack support
    - Fix #522 signed integer overflow
    - Fix #523 incorrect PHP reflection type for Memcached::cas $cas_token
    - Fix #546 don't check key automatically, unless client-side verify_key is enabled
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants