Skip to content

Convert JavaZlib from byte arrays to NIO ByteBuffer#3981

Open
winnpixie wants to merge 3 commits into
SpigotMC:masterfrom
winnpixie:wpx-nio-zlib
Open

Convert JavaZlib from byte arrays to NIO ByteBuffer#3981
winnpixie wants to merge 3 commits into
SpigotMC:masterfrom
winnpixie:wpx-nio-zlib

Conversation

@winnpixie
Copy link
Copy Markdown

@winnpixie winnpixie commented May 16, 2026

This PR reimplements the JavaZlib class. Previously, BungeeCord used byte[] arrays that were copies of the content of a Netty ByteBuf. This has performance and memory penalties. With these changes, JavaZlib will utilize the underlying NIO ByteBuffer(s) that back a ByteBuf. While this implementation still has its drawbacks (buffering is utilized to transfer data after Deflate/Inflate calls from ByteBuffer->ByteBuf), I believe this will lay the groundwork required for someone to take initiative in ensuring this code is performant.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant