FAQ - astei/krypton GitHub Wiki

What is in Krypton right now?

Krypton already includes quite a few performance improvements. Some of them, like flush consolidation, can improve your server tick times and lead to a smoother experience. Others reduce CPU time or reduce garbage allocation.

The following components are included in Krypton and work on either the client or the server:

  • Optimized packet splitting, derived from work done in the Velocity project.
  • Micro-optimizations to reduce garbage produced by the networking stack.
  • Ability to finely control how packets are sent to clients or the server (although this is currently only implemented for server to client communication).
  • Optimizes packet compression with the following strategies:
    • Normal Java Inflater and Deflater APIs (same as vanilla)
    • Java 11+ Inflater and Deflater APIs (allow the usage of direct buffers to reduce memory usage)
    • JNI implementation that uses libdeflate, which is usually significantly faster than the JDK/system zlib (only available for Linux x86_64 and Linux aarch64)
  • Optimizations to the Minecraft entity tracker (can help single-player client and server performance with lots of entities in the world)
  • Sends all chunk packets in a spiral pattern

The following components are included in Krypton, but work on the server-side only (this includes the integrated multiplayer server and dedicated servers):

  • Introducing optimized encryption that work on the network buffers directly (client support planned, Linux x86_64 and Linux aarch64 only)
  • Flush consolidation for player connections (targeted to places in the server that send the most packets)

Why does some of the functionality only work on Linux?

There are several practical reasons for me to focus on Linux first:

  • I use Linux as my primary development platform. This is largely personal preference but it helps that native development tools on Linux are often faster and better than on Windows. This makes prototyping new potential features easier.
  • Krypton often introduces native code for certain highly-optimized libraries that are not written in Java and where the benefit of using the library is able to pay for the cost of a JNI transition. However, when we use a native library, we need to invest effort into compiling and testing the code on each platform we intend to support that library on. Since Linux is my main development platform, the cost for Linux support is effectively free.
  • Most of the functionality Krypton introduces has the most impact on the server. While the Minecraft client uses the same networking components as the server, it does not utilize the networking stack as heavily as the server. Most Minecraft servers are deployed on Linux servers, be that through a shared host, someone repurposing an old computer to run a Minecraft server, or buying a dedicated server. It makes the most sense to invest in Linux first.
  • In the case of encryption, the OpenSSL library is used to support direct encryption of packets without requiring memory copies. While OpenSSL is common on most free and open source *nixes, it is notably absent from Windows and not in any reasonably up-to-date form on macOS. In the US, the export of cryptography has some restrictions and I do not want to bother with it, so I let the Linux distributions handle this issue for me.

Does Krypton require any other mods?

No.

Is Krypton compatible with the Fabric API?

Yes.

Is Krypton compatible with Lithium/Sodium/Phosphor?

Yes.

Lithium does include a mixin that would conflict with Krypton, but we explicitly disable it so there are no conflicts. Krypton reimplements the Lithium mixin in a more effective way.

Is Krypton compatible with Bukkit4Fabric/Cardboard?

Apparently it works, but we strongly recommend against using it. The Bukkit/Spigot API was simply not designed to support modding.

We recommend finding Fabric-based alternatives to Bukkit/Spigot plugins or just using Paper instead. Paper contains most of the optimizations from Krypton, was the origin of the LazyDFU mod, includes a number of optimizations similar to Lithium, and has the extremely fast Starlight lighting engine integrated.

Is Krypton compatible with Immersive Portals?

Yes, as of Krypton 0.1.7.

Is Krypton compatible with <some other mod not explicitly called out>?

Probably. Try it and see. If you find a problem, we have an issue tracker.

Can I use Krypton for speed-running?

Yes!

Can I use Krypton on server X?

It depends on the server's rules. You use Krypton in multi-player at your own risk. Krypton implements functionality that is wire compatible with vanilla servers and clients, so in terms of compatibility with other servers, Krypton shouldn't break anything (exception: in some configurations, Krypton is incompatible with servers running the LilyPad proxy, see #22 for more details). However, the use of Krypton may be prohibited by servers. For instance, take Hypixel's acceptable mods list. Hypixel allows "Client Performance Improvement Modifications" which are defined as:

Modifications which simply seek to improve the performance of the Minecraft client without making changes to the game itself, such as those which improve the FPS of the Minecraft client.

Without a doubt, Krypton seeks to improve the performance of the Minecraft client. However, there is also this prohibition:

Finally, modifications which alter the way in which your Minecraft client interacts with and communicates with our server are also strictly disallowed, even if they otherwise fall into an allowed category. Please ensure that any modifications which are used are strictly client side only, with them not changing or altering the behaviour of the game.

Krypton unquestionably modifies the way the Minecraft client communicates with the server (by replacing parts of the pipeline, for instance), albeit in a wire-compatible fashion. For this reason (and to err on the side of caution), it is my belief that Krypton would not be acceptable on Hypixel.