Skip to content

Allow controlling the setting at which libdeflate only emits an uncompressed deflate stream #67

@astei

Description

@astei

libdeflate has truly entered the mainstream when it pops up in Minecraft, as I do in Velocity 1.1.0. In Minecraft, there is a need for fast, real-time compression, and libdeflate fills an important need for accelerating the zlib/deflate-based compression used by the game's protocol.

I recently ran across a need to use libdeflate in the protocol of Minecraft: Bedrock Edition. This game is... strange, and it's not a natural fit for libdeflate's block-based decompression. In this particular edition of the game, though, everything is deflate-compressed and this wastes CPU. While libdeflate by default only emits uncompressed deflate streams for inputs that are less than 16 bytes in length, this still wastes quite a bit of CPU on our end for the small packets the game often sends and we had a need to raise this to 128 bytes. For now, we run a modified libdeflate where we patched the relevant check but we'd like to make it configurable if possible so we can run vanilla libdeflate.

Thanks for making this library, it's greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions