Skip to content

Conversation

@rhpvorderman
Copy link
Contributor

@rhpvorderman rhpvorderman commented Jan 24, 2023

See the accompanying issue for a detailed explanation. BlocksOutputBuffer was introduced in Python 3.10 and the benchmarks back then showed increased performance on larger output buffers. Smaller output buffers were not benchmarked however. In the accompanying issue I show why the previous buffer scheme works better for smaller output sizes. Since small data packets and streaming is more common than large in-memory compression it is beneficial to switch back to the 3.9 python style of arranging the buffers.

This also leads to a lot less code.

I changed one thing from the pthon 3.9 code: the lzma and bz2 buffer sizes do not follow a complex grow pattern but simply double the buffer (just like the zlib module). This only really hurts large in-memory compression but that is an anti-pattern anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants