Behind The Scenery Engine: Concurrent
Performance go brrr.
What is this?
Behind The Scenery Engine: Concurrent is a massive optimization mod featuring multithreading, deadlock elimination mechanism, lock-free synchronization by utilizing CAS/Lock-Free architectures. This mod provides significant performance boost on servers and singleplayer worlds. Instead of many other attempts to recreate multithreading, we were using a more invasive approach. We've tried to optimize everything we could touch without breaking most mods by reworking Minecraft pipelines.
Please note, that this mod is in ALPHA stage of development. Something may break. Something may crash. Here be dragons, do backups.
At the moment of writing, performance boost may vary from the modpack and the user's PC setup.
Benchmark
We've had benchmarking the mod on a heavy modpack with lots of world generation datapacks and mods with mods such as Create, Mekanism, Ice and Fire and so on.
Testing Modpack:
- Massively buffed structure rates up to 2x~4x, added a datapack which generates the whole worlds as islands utilizing lots of density functions.
- Render Distance set to 32 chunks, simulation distance to 8 chunks
- 341 mods loaded, half of them are about structures or adding biomes/other worldgen stuff.
Testing Environment:
- CPU: AMD Ryzen 3700X 8-Core Processor
- RAM: 32GB 2133MHz, ~11GB allocated to modpack.
Benchmark Data:
- No Mod: 4m 55s to load the whole world from pushing the "Generate World" button to everything loaded around the player. Very slow chunk generation from
- With C2ME (0.3.0.alpha73): 2m 20s (2.1x faster) to load the whole world from pushing the "Generate World" button to everything loaded around the player, but may hang the world out due to random deadlocks. Sometimes chunks may just stop loading at all requiring the whole modpack reboot. Some trees or world generation stuff are missing, some minor unnoticeable differences in the world generation.
- With Behind The Scenery Engine: Concurrent (0.1.4-alpha): 2m 27s (2.006x faster) to load the whole world from pushing the "Generate World" button to everything loaded around the player. No specific issues were found except some mod incompatibilities, see below.
Known Incompatibilities and Notices
While we aim to make this mod to be compatible with your favourite mods where possible, some mods may require some patches to work with Behind The Scenery Engine: Concurrent. Feel free to file an issue if there are any other incompatibilities we don't know.
Somewhat Compatible (see notes)
- Confluence: Otherworld
- Proceeds to the Main Menu. The game loads the world successfully.
- If the mod is present in the modpack, there will be small, or nearly to no performance improvement in the modpack. This happens due to attempt to read
PalettedContainer
data each tick, because the mod have Corruption and Crimson biomes that are mutable and spread all over the world making the game load rates much slower and this whole mod inefficient. However, there won't be any issues with the mod itself, only degraded performance. Requires a bunch of patches to their biome code to resolve this.
- Async
- Proceeds to the Main Menu, but the game crashes on world generation sometimes.
- However, if you randomly manage to not crash the game using
0.1.7.alpha.7
or later builds, then you'll be able to play as intended? It is unknown if the performance will be boosted from the Async side, but the modpack probably will work as intended, but some stuff may arise like frozen deadlocked entities or something like this.
Incompatible
- Lithium
- Proceeds to the Main Menu. The game loads the world successfully, but makes it unplayable due to broken mob spawnrates. Sitting in a world around ~3-5 minutes hangs the world out with thousands of newly spawned entities.
- This is caused by the
toNbt
method being overwritten and destroying the whole ticking pipeline. Requires a patch from the Lithium's side. - If this will be patched, then you'll still need to configure Lithium through it's config to disable
PalettedContainer
andSerialization
patches, so this mod won't crash your game. To resolve this, add tolithium.properties
these lines:mixin.chunk.palette=false
andmixin.chunk.serialization=false
. This will allow the game to run smoothly without any random crashes.
- Concurrent Chunk Management Engine (C2ME)
- Does not proceed to the Main Menu.
- This mod uses various mixins and patches across the chunk management system making this incompatible. This mod aims to do the same thing in a more friendly and compatible way than Behind The Scenery Engine: Concurrent.
- Noisium
- Does not proceed to the Main Menu.
- Technically, it is obsolete if it is installed with Behind The Scenery Engine: Concurrent, because we do mostly all the same tricks of Noisium, but in a proper and structured way in terms of lock-free/CAS architecture. Even if it launches somehow or will launch eventually, there won't be any performance boost from the Noisium side.
How to use?
For players, just download a mod file called btsengine-concurrent-x.x.x.jar
, put into the mods
folder and run the game. That's it!
For mod developers, currently the project is All Rights Reserved. However, the license may be changed at a later time when we will feel that the project is in a more polished state. If you believe that we're doing something wrong, please reach us through Issues section, so we could sort it out and fix it.
Ports/Backports?
This project is so huge, so it is very hard to maintain this across Minecraft versions. At the moment, 1.21.1 and NeoForge are the only versions/modloaders supported.
- Fabric? Maybe if there will be demand.
- 1.7.10, 1.12.2 or any other version <1.21.1? No. It will require a lot of work from us to port over these versions.
- - The exclusion may be 1.20.1, but it will be discussed later by the whole team, when we will feel that the project is on the state we would like to see.
- 1.22, 1.23? We're not sure if we want to update the project to newer versions. The time will see. However, if something changes, we'll announce it here and there.
License
You can use this mod in any public modpacks hosted across CurseForge and Modrinth without written permission to mod owner or authors.
You can also use this mod in any modpacks or projects on other websites, but you need to credit back to mod official respective pages.
You can use this mod in any, original or modified, form in private modpacks as long as they're not released into public.
You can freely, free of charge, create videos and/or livestreams with this mod, crediting that you are using this mod is advised, but not required.
You cannot modify this mod without written permission for the public modpacks or projects from the mod owner or authors if owner is unaccessible.
You cannot claim this mod as yours in any possible way.