Re: [RFC] Modern Compression (zstd, brotli)
| From: | Benjamin Außenhofer | Date: | Tue, 18 Feb 2025 20:38:35 +0000 |
| Subject: | Re: [RFC] Modern Compression (zstd, brotli) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126460@lists.php.net to get a copy of this message | ||
Am 18.02.2025, 11:19:26 schrieb Jordi Boggiano <j.boggiano@seld.be>:
> Hey,
>
> Kévin Dunglas and myself would like to present this RFC proposing
> inclusion of the zstandard and brotli pecl extensions into core, with
> the main goal of making them more broadly available.
>
> https://wiki.php.net/rfc/modern_compression
>
> Thanks for your consideration, we're looking forward to hearing your
> feedback!
>
I really like the idea to add both to core and the reasoning to add Brotli
as well given Safari constraints.
As Tim said, the API could use simplification and improvement. I would
propose that the constructor of a compressor gets all the options and the
interface method itself are really always single argument data in, data out..
For Zstd dictionary support you could just add a second class (or an
optional parameter) in the ctor. Rough idea (constant values and variable
names and types for ctors are mostly made up):
https://gist.github.com/beberlei/6f3d365f79959e3ded07e6a1f1351a1b
greetings
Benjamin
>
> Best,
> Jordi
>
> --
> Jordi Boggiano
> @seldaek - https://seld.be
>