Resource Trimmer - Minecraft Network Traffic Optimization
This modification improves the efficiency of network communication in Minecraft by eliminating redundant data in resource identifiers. Each use of the default namespace saves 10 bytes of traffic.
How It Works
Minecraft uses namespaced identifiers to designate game objects. Each such identifier consists of an optional namespace and a path. If the namespace is not specified, minecraft is applied by default. However, standard network encoders still transmit this namespace, creating unnecessary network load.
Optimization Effectiveness
Each use of the default namespace adds 10 extra bytes. As a result, the login process is reduced by at least 105 kilobytes. When additional content is installed, the savings increase - for example, for the ATM 10 modpack, the savings amount to at least 125 kilobytes.
Although these numbers may seem small, eliminating redundant data is especially important for players with poor internet connections and for servers with many users. The mod also helps prevent issues with exceeding the 2 megabyte packet size limit.
Here is the approximate transmission time for a 120 kilobyte packet under ideal conditions:
- 5 Mbps = 192 ms
- 10 Mbps = 96 ms
- 15 Mbps = 64 ms
- 100 Mbps = 9.6 ms
- 200 Mbps = 4.8 ms
- 500 Mbps = 1.92 ms
- 1000 Mbps = 0.96 ms
Important: 120 kilobytes equals 960,000 bits, and a 1 Mbps connection transmits 1,000,000 bits per second. Providers indicate speed in megabits, not megabytes, which can be misleading.
Compatibility
The changes made by this mod are fully compatible with clients and servers, even if they don't have Resource Trimmer installed. For example, modified servers will send reduced packets to any clients, and modified clients will send them to any servers, including vanilla ones. These changes also work in singleplayer and LAN mode, where the integrated server is used.
For maximum effect, it's recommended to install the mod on both clients and the server.
Technical Features
Resource Trimmer uses Mixin to make changes. Although this is a standard approach for modern Minecraft mods, there's always a risk of incompatibility with other mods or modified clients. The changes made comply with the vanilla specification and should be compatible with everything that fully implements it. No incompatibilities have been identified to date.