mojira.dev
MC-145744

Villager AI (POI detection) pegs CPU at 100%

Fine-Structure is a casual-play 1.13.2 server that we use for testing purposes. Loading it up into 19w11a exposes a new severe performance problem. One thread dominates the CPU time and pegs the CPU at 100%. I used async-profiler to analyze this, and a screenshot is attached. The full profile in HTML form can also be found at "https://www.dropbox.com/s/33lqat9x3yzkdny/tree2.html?dl=0".

According to people from the Fabric project, this is villager AI. Rockenroll4life confirmed that there's a new AI engine.

We do have a fair number of villagers in one area. In 1.13.2, there were lag problems due to entity collisions. In 1.14, the collision problem is fixed, but now there's significant lag caused by villager AI processing instead.

Linked issues

Attachments

Comments 17

By running the internal debug profiler, you can see that minecraft:villager.ai.newAI.mob tick.brain is now generally leading the tick time.

Timothy Miller

This is still a problem in 19w13a. According to boq, this relates to villager POI detection. I also uploaded a profile (from async-profiler) for 19w13a.

Still an issue in 19w14a

ProfMobius (Thomas Guimbretiere)

Do you have a test world associated with that trace so we can reproduce the circumstances of the bug ?

Timothy Miller

Hi, Prof,

We do have a test world. I don't want to post a link here due to privacy reasons, but I sent a download link to Boq. Also, feel free to contact me on Discord via EigenCraft (https://discord.gg/AbYpWWJ), and I can send you a link too.

Thanks.

7 more comments

Got this issue too. 1.14.1

Timings profiler, for reference this was ~50 villagers vs 637 zombies and the villagers still caused more lag

[media]
Kamil Pigłowski

I can only confirm that as far as I know after many days of testing on my server villagers and pillagers AI is broken and causing enormous resources usage as well as server crashes from time to time.

@unknown Which version are you in?

Kamil Pigłowski

@Johnibur
I'm on 1.14.2

Adrian Östergård

Is this still an issue in 1.14.4 or later?

Timothy Miller

(Unassigned)

Community Consensus

Performance, Village system

Minecraft 19w11a, Minecraft 19w13a, Minecraft 1.14.1, Minecraft 1.14.2

Minecraft 19w12a, Minecraft 1.14.1 Pre-Release 1

Retrieved