Krypton

Krypton

22M Downloads

Allow experimenting with non-standard compression algorithms

astei opened this issue ยท 6 comments

commented

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.

commented

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.

commented

Ideas for supported compression algorithms:

  • LZ4
  • zstd (customizable level)
commented

Sound like a really good idea especially being able to use LZ4 Which is much more efficient.

commented

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.

commented

how is it going

commented

how is it going

A bit late, but you didn't even read the issue:

This isn't a priority, it's more of a science project.

The concept works, but I don't think Krypton is the best place to develop it further. Mojang needs to make the move, IMO.