LazyDFU - Minecraft Loading Speed Optimization
LazyDFU is a Minecraft optimization modification that postpones unnecessary initialization processes until they are actually needed. Specifically, it makes DataFixerUpper loading "lazy" - meaning that rules for migrating data from older Minecraft versions to newer ones are created only when there is a real need for them.
Version Compatibility
LazyDFU version 0.1.2 is compatible with Minecraft from 1.14 to 1.18.2 and works on both client and server. Version 0.1.3 supports Minecraft 1.19 and above, although Mojang has already implemented similar functionality on the server side. On the client side, all DFU rules are still loaded by default, so LazyDFU intercepts the native client functionality and disables unnecessary operations.
It's worth noting that starting from Minecraft 1.19.4 and above, the developers have significantly optimized the DFU initialization process, so in many configurations this modification is no longer required. Nevertheless, it continues to be supported for older versions of the game.
How It Works
DataFixerUpper (abbreviated as DFU) is a Minecraft component responsible for updating worlds from older game versions to newer ones. DFU initializes very early in the Minecraft startup process - in fact, before the game window appears. This component is overly complex and works very slowly, but it's what Mojang provides us.
During the initialization process, DFU caches rules necessary for converting from older versions through all intermediate versions to the current game version. This process occurs in the background, but it is extremely slow and requires significant CPU and memory resources. For example, for Minecraft 1.16.5, this process takes 9 seconds on a powerful Ryzen 9 3900X processor and a full 57 seconds on a mid-range laptop i5-8250U processor.
LazyDFU simply stops this process - it allows DFU to initialize but prevents caching all these rules. As a result, DFU rules are compiled only when a world needs to be converted. This may lead to temporary lags during migration rule compilation, but after the process is completed, no performance degradation is observed.
Effectiveness Demonstration
For a visual demonstration of the modification's effectiveness, a YouTube video is available showing the real difference in loading speed.
Advantages Over Other Mods
Compared to other optimization modifications, LazyDFU has several key advantages: simplicity, safety, and minimal impact on the game.
LazyDFU is a very simple modification. The entire code takes only about a dozen lines, making it maximally simple while providing significant performance improvement. This also makes it an ideal option for experimenting with new Mixin platforms!
The modification has high compatibility and safety. The likelihood of conflicts with other mods is extremely low. LazyDFU is based on a similar patch in Paper that was used for over a year without reports of problems when migrating to new Minecraft versions.