-
Notifications
You must be signed in to change notification settings - Fork 36
FAQ
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).
- Ability to replace the compression format used by the Minecraft protocol:
- Normal Java
Inflater
andDeflater
APIs (same as vanilla) - Java 11+
Inflater
andDeflater
APIs (allow the usage of direct buffers to reduce memory usage) - Specially hand-rolled implementation of libdeflate ported to a Java library, which is usually 2x faster than zlib (only available for Linux x86_64 and Linux aarch64)
- Normal Java
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).
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.
No.
Yes.
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.
No, see CardboardPowered/cardboard#103. But you shouldn't use it. Instead we recommend cutting your losses and either finding Fabric-based alternatives, or using an actual CraftBukkit fork, such as Tuinity.
Probably. Try it and see. If you find a problem, we have an issue tracker.
Yes!
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.