Sepals

Sepals

Mod

An extremely radical and experimental optimization for Minecraft server performances.

Server Optimization

2,223 downloads
53 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

Sepals is a experimental optimization mod for minecraft server, aims to minimize latency in game-ticking simultaneously keeping the vanilla features unchanged.

Installation

Sepals needs Fabric API on Fabric, needs Architectury API on NeoForge, and Sepals will always following the newest version of Minecraft, please ensure you are installed the requirement mods and the Minecraft that matched to Sepals required version.

Issues

Sepals is not very stable well, a lots of potential bugs is not not yet found.

So please report all not vanilla behaviors to sepals's github issues that was happening, and could attach a spark profiler result, thanks!

Compatibility

Currently, sepals are compatible to almost all mods (If not new issues opened).

Here is verified mod list:

Target mod Target mod version Recommend target version Sepals version Recommend sepals version
sodium all all all latest
iris all all all latest
ferritecore all all all latest
krypton all all all latest
lithium >=0.14.1 latest >=1.0.4 latest
c2me-fabric >=0.3.0+alpha.0.295 latest >=1.0.5 latest
moonrise-opt >=0.1.0-beta8 unknown >=1.0.6 latest
async >=0.1.5+alpha.8-1.21.4 unknown >=1.0.11 latest

If you don't know which version to choose, please use the latest version of all the optimization mods, Sepals will ensure compatibility with them.

Specially

When Sepals work with mod Async testing on different platforms has different results, please use configurations to disable Sepals features or Async features to test which is more worthwhile if you want use both together.

Sepals feature related: enableSepalsEntitiesCramming.

Performance

Sepals has been tested on Intel i7-14700K, 4G RAM for java, Minecraft 1.21, there are 800 frogs cramming in a 7x7 space:

Biased long jump task
Environment keepRunning Percent(Avg.)
Vanilla
(LongJumpTask)
43.1 ms 100 %
With Lithium
(LongJumpTask)
7.5 ms 17 %
With Sepals
(SepalsLongJumpTask)
0.2 ms 0.4 %
With Sepals+Lithium
(SepalsLongJumpTask)
0.05 ms 0.1 %
Environment getTarget Percent(Avg.) Percent(in keepRunning)
Vanilla
(LongJumpTask)
43.1 ms 100 % 100 %
With Lithium
(LongJumpTask)
3.6 ms 9 % 48 %
With Sepals
(SepalsLongJumpTask)
N/A ms 0 % 0 %
With Sepals+Lithium
(SepalsLongJumpTask)
N/A ms 0 % 0 %
Quick sort in NearestLivingEntitiesSensor
Environment sort (NearestLivingEntitiesSensor#sense) Percent(Avg.)
Vanilla 3.8 ms 100 %
With Lithium 3.6 ms 94 %
With Sepals 2.2 ms 57 %
With Sepals+Lithium 2.2 ms 57 %
Frog attackable target filter
Environment time Percent(Avg.)
Vanilla (FrogAttackablesSensor#matches) 10 ms 100 %
With Lithium (FrogAttackablesSensor#matches) 5.7 ms 57 %
With Sepals (SepalsFrogBrain#attackable) 0.1 ms 1 %
With Sepals+Lithium (SepalsFrogBrain#attackable) 0.1 ms 1 %
Frog look-at target filter
Environment findFirst Percent
Vanilla
(LookAtMobWithIntervalTask$$Lambda#findFirst)
2.7 ms 100 %
With Lithium
(LookAtMobWithIntervalTask$$Lambda#findFirst)
2.5 ms 92 %
With Sepals
(SepalsLookAtMobWithIntervalTask$$Lambda#findFirstPlayer)
0.1 ms 3 %
With Sepals+Lithium
(SepalsLookAtMobWithIntervalTask$$Lambda#findFirstPlayer)
0.1 ms 3 %

and 800 villagers cramming in a 7x7 space:

Villager miscellaneous optimizations

at noon:

Environment Brain#tick (Total) Percent Brain#startTasks Percent(startTasks) Brain#tickSensors Percent(tickSensors) Brain#updateTasks Percent(updateTasks) Brain#tickMemories Percent(tickMemories)
Vanilla 18 ms 100 % 9.3 ms 100 % 5.2 ms 100 % 3 ms 100 % 0.5 ms 100 %
With lithium 12.4 ms 68 % 4.8 ms 51 % 5.9 ms 113 % 1.2 ms 40 % 0.5 ms 100 %
With Sepals 9.7 ms 53 % 3.6 ms 38 % 3.7 ms 71 % 2 ms 66 % 0.4 ms 80 %
With Sepals and lithium 10 ms 55 % 3.4 ms 36 % 3.7 ms 71 % 2.5 ms 83 % 0.4 ms 80 %

at night:

Environment Brain#tick (Total) Percent Brain#startTasks Percent(startTasks) Brain#tickSensors Percent(tickSensors) Brain#updateTasks Percent(updateTasks) Brain#tickMemories Percent(tickMemories)
Vanilla 16.7 ms 100 % 8.2 ms 100 % 6 ms 100 % 2 ms 100 % 0.5 ms 100 %
With lithium 10.2 ms 61 % 3.2 ms 24 % 6 ms 113 % 0.5 ms 25 % 0.5 ms 100 %
With Sepals 9 ms 53 % 3.3 ms 16 % 4.7 ms 78 % 0.7 ms 35 % 0.3 ms 60 %
With Sepals and lithium 8.7 ms 52 % 2.9 ms 11 % 4.6 ms 76 % 0.7 ms 35 % 0.5 ms 100 %

and 1390 villagers cramming in a 7x7 space:

Entities cramming
Environment tickCramming Percent(Avg.)
Vanilla 53.6 ms 100 %
With Lithium 54.4 ms 101 %
With Sepals 10.2 ms 19 %
With Sepals+Lithium 8.5 ms 15 %

What was it doing

  1. Used Catheter to replaced java stream, The newest version Catheter has more quite stunning performance and scalability than Stream
  2. Cached tasks, activities, running tasks and memories to improves starting and updating task
  3. Use sepals composite task to replaced vanilla composite task
  4. Whenever possible, find opportunities to skips more raycast and useless predicates
  5. Use 'SepalsLivingTargetCache' to replaced vanilla cache, At the cost in sensors tick make less cost in finding interaction target or look at mob task
  6. Rearranged predicates and extra lower cost predicate, The purpose of this is do higher cost predicate later or best don't do that, Skip the remaining high cost predicates in advance
  7. Copied and modified 'SerializingRegionBasedStorage' optimizations from lithium
  8. With more targeted task, don't use the generics to reduce useless operations
  9. Used binary search list to replaced hashset search
  10. Use quick sort (fastutil) to replaced tim sort (java std)
  11. Precalculate and cache any useful data, avoid unnecessary repetitive calculations
  12. Do more cache, space for time

Notes

  1. Sepals just try to minimizing the game-ticking latency, it won't help with network latency!
  2. Sepals are currently not extensive long-term testing, occur bugs it is possible
  3. Only supported Fabric and NeoForge now, no Forge, no Quilt, and no other any modloader

Project members

cao-awa

Member

Details

Licensed GPL-3.0-only
Published 4 months ago
Updated 22 days ago