aio-libs / aiohttp

Asynchronous HTTP client/server framework for asyncio and Python
https://docs.aiohttp.org
Other
15.13k stars 2.02k forks source link

Add support for switching the zlib implementation #9798

Open bdraco opened 2 days ago

bdraco commented 2 days ago

Is your feature request related to a problem?

I'm currently maintaining https://github.com/bdraco/aiohttp-fast-zlib which allows swapping out the standard lib zlib for isal or zlib-ng since its a ~5x performance improvement

Describe the solution you'd like

Native support

Describe alternatives you've considered

n/a

Related component

Server

Additional context

No response

Code of Conduct

Dreamsorcerer commented 2 days ago

I'd note that we do have downstreams that use zlib-ng as the default zlib library. We had a complaint that the zlib tests were failing in their environment, and it was because they were using zlib-ng and thus getting different binary representations.

Not against allowing different Python libraries though.

bdraco commented 2 days ago

I recall seeing that. Do you happen to remember the issue where it was reported. It would be good to make sure the tests are adjusted to pass for isal, zlib, and zlib-ng

bdraco commented 2 days ago

found https://github.com/aio-libs/aiohttp/issues/7255

Dreamsorcerer commented 1 day ago

Yes, as I mentioned at that time, we should keep the binary tests as internal and add new tests which verify the decompressed results.

The binary tests are useful to tell if we've messed up the compression in our code (we had a PR which clearly broke the compression efficiency by restarting the compression on each line or something).