
Allow experimenting with non-standard compression algorithms
astei opened this issue ยท 6 comments
Right now, Minecraft uses the zlib format to compress packets. Krypton currently supports substituting it for libdeflate. zlib is over 20 years old by now and there are more modern algorithms perfect for near real time compression. This has been something I've wanted to experiment with (and so does @Spottedleaf).
This isn't a priority, it's more of a science project.
Idea
When a Krypton-enabled client connects to a server, it sends a list of all the compression algorithms it supports. The server will pick one and send the algorithm to use to the client. Once SetCompression
is sent, the client will use that particular algorithm. If the server doesn't recognize the compression negotiation attempt, assume zlib format.
Further work on this is likely to involve adding a dependency on the Fabric API. Considering that this is impermissible for Minecraft speedrunning, I'm closing this issue. I may create a fork of Krypton with more experimental features but don't expect it to be updated frequently.
Sound like a really good idea especially being able to use LZ4 Which is much more efficient.
I have run some experiments with zstd on level 3, which is very close to the default level 6 compression that zlib uses (and thus Minecraft and Krypton). Profiling shows a 50-60% reduction in CPU time spent compressing packets with only 4% larger compressed packets. This is a clean kill to me and shows that there is promise.