Sable: Optimized Entities
A small optimization patch mod for Sable, for faster entity tracking in Sublevels. It can be installed in the server, meaning no requirement for players to update their modpacks and add the same mod as well.
NOTE: This mod does not guarantee full stability, even though it is mostly free of bugs in my testing.
How does it work?
Originally, Sable had a mixin code that lets players see entities within a Sublevel properly by sending the converted entity positions inside of specific Sublevels to the players.
But something is wrong, checking and grabbing Sublevels had extra slow calculations. And that mixin code always checks if the entity was inside of a Sublevel and grab said Sublevel if it does, by a BUNCH of times.
For example, assuming there are 20 players and 1000 entities loaded where all of them are near to each other and not inside of the sublevel. If we do the math where 20 Players x 1000 entities, Sable's sublevel checking code runs around 20,000 TIMES at every tick. Inside of a normal world, there are majority of the entities aren't at the sublevel, yet STILL finds their non-existent sublevel, and that is pretty bad for performance.
So I've made this ultra-specific mod that does faster tracking to lessen the chances to check for sublevels in entities while players can still see entities on sublevels properly like before.
Use this mod if you have:
- Tons of active entities that aren't inside of any sublevel (especially with mobs and items)
- Many (such as 20 or more) active players.
- A lot of chunks (around 5000) are loaded
ChunkMap.move()specifically eating your TPS according to Spark- A low-end server
If none of these are applicable, then this mod will not be effective for you.
Benchmark
Tested from an Aeronautics server (STARSOUL) with ~25 real players, ~5100 chunks, and ~3500 active entities with an AMD EPYC 4564P CPU and 12GB allocated.
Without Mod

With Mod

Meaning this mod does ~3.7x faster entity tracking than Sable does. Ain't that neat?
| Version | Minecraft | Loader | Download |
|---|---|---|---|
|
Sable: Optimized Entities 0.1.0 0.1.0 |
1.21.1
|
neoforge
|
Download |