Experimental Performance

improves Minecraft performance in several aspects

by
26.1K Downloads
fabricoptimization
Rent Server with this Mod

About this Mod

Memory Allocation
Some classes can be very memory dense, they have a big memory footprint.
This is an issue because your computer can only fit 64 bytes into a processor's cache line, so anything over 64 needs to be split into multiple lines. This can drastically slow down operations based on what is being called.
So obviously the best solution is to make sure nothing is over 64 bytes, this is a lot easier said than done, since there's multiple downsides to this, although they don't matter in the circumstances that ive optimized.

Chunk Memory Allocation
Chunks are very memory dense and take up 80 bytes. Using some hacky fabric-ASM we are able to nuke variables from the Chunk class and redirect all the calls.
This allows us to bring the chunk back down to 64, which on some computers can make most chunk operations 0.25x faster!

Block Memory Allocation
Blocks are also very memory dense, taking up 72 bytes.
We do the same thing as Chunks, we move stuff into a BlockInfo class and reduce the weight of the class.
This not only makes it so most blocks can now be passed along faster, but also prevents some blocks from going over 128 bytes, which would need 3 cache lines.

Entity Memory Allocation
Unlike Chunk & Block, entity is its own nightmare. It takes up 272 bytes, which is 5 cache lines. No wonder entities are laggy xD
I've optimized it to 4 cache lines, although going any further will break more mod compatibility than I have the time to fix.
If the mod grows big enough at some point, I may rewrite the entire entity class and just provide an API for the values you would want.

Why is Mojang not doing this?
Well they kinda are?
When making my optimizations I noticed that mojang has actually made the same performance improvements that I'm doing. Such as LevelInfo, although that was years ago?
Mojang does not seem to care about performance much these days, they make really weird performance changes but never seem to really care too much. Some classes have grown a lot in the last years, and they haven't really noticed how dense they have become.
That's fine though, cause I'm here to help.

The game of cat and mouse
Performance is hard to get more of, it's a very complex puzzle which requires you to understand every single part of it in a lot of detail.
Put simply, computers are not simple. They try really hard to make it easier for the programmer to not think about it, although programmers should be thinking about it at all times.
What am I talking about?
Well the performance I get with this mod comes at a cost, extra calls and memory allocation. I'm simply optimizing the structures within the game to work as smoothly and quickly with the computer, although that requires the computer to remember more things.
Unfortunately, you won't notice that cost since in most of these situations the performance win greatly overcomes the loss.

Experimental!!!
Seems I need to continue saying it. This mod is highly experimental and does some super sketch ASM magic to gain performance by simply moving classes around. Do not include this in modpacks, and do not make issues about compatibility. This mod was made as a proof of concept to see if we could further optimize minecraft by reducing the classes sizes in the cache lines. This mod showed a clear performance win, although its pretty untested and still needs LOTS of work. I don't have time to continue working on this mod currently

Available Versions

ExperimentalPerformanceUnofficial 0.1.1beta
MC 1.20.4fabric
December 28, 2023

How to Install Experimental Performance on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.20.4).

3

Install Mod

Open the mod browser in the dashboard and search for "Experimental Performance". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.20.4

Server-side

~ Optional

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Experimental Performance server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.20.4). You can switch loaders with one click in the panel.

Is Experimental Performance compatible with fabric?

Experimental Performance officially supports fabric for Minecraft 1.20.4. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Experimental Performance – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Experimental Performance consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Experimental Performance with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
Apache License 2.0
Server-side
Optional

Supported Versions

1.20.4