High-density mobs cause high CPU usage
When mobs are packed densely (as in many popular farm designs), server CPU usage is absurdly high.
Repro steps:
- Start a local default-parameter flat world (I used seed 0 and was in Creative with no structures)
- Swap to desktop, use Task Manager to note idle CPU usage (for me this was 40% on one thread of one core)
- Make a 1x2x1 volume (I used dirt)
- Use cow spawners to place 16 cows in the volume
- Swap back to Task Manager, note problematically higher idle CPU usage (This was ~65%)
- Drop in another 48 cows
- Note much higher CPU usage (I also noted the load bounces somewhat between cores under this load)
On a map that was running fine on Realms before the 1.9 update, I now see 10-15 game ticks per second. Emptying the high-density cow and chicken farms lets it get back up to 20 TPS.
I tried to carefully repro this, and it's not exactly consistent. I used a splash potion to empty a second cow silo and then refilled it, and the CPU usage wasn't as high as before. This definitely repros with a full minute's worth of cow spawners in the silo though on Realms, and 1.8 handled it alright. I also could get tick stoppage with only 16 cows and a very modest amount of Redstone in the original repro Realm.
Please note that I am not saying dense farms shouldn't cost CPU; I'm saying that the cost has been multiplied immensely by v1.9.