Mob spawning algorithm is super slow
The bug
The mob spawning algorithm is slow and impacts the game's TPS. This is mostly noticeably in a flat world with the gamerule doMobSpawning enabled; the tps heavily decreases. When checking the source with /debug, it showed mobSpawner as source:
[00] levels - 99.62%/99.62% [01] | New World - 99.82%/99.45% [02] | | tick - 98.85%/98.30% [03] | | | mobSpawner - 91.42%/89.87% [03] | | | entities - 6.79%/6.67%
The lag impacts all worlds, but the amount of impact depends on how many mobs are able to spawn. (normal world with high render distance will lag more than a normal world with low render distance, for example)
How to reproduce (using a flat world, since it's most noticeably there)
- Create a flat world (default settings)
- Observe that everything is really slow (slimes, animals, sun)
- Disable doMobSpawning:
/gamerule doMobSpawning false
- Now the tps is back to normal
2018-05-15, 06:36 PM
2018-06-15, 11:32 AM
2018-06-15, 11:32 AM
18
10