Rotating objects by scripts causing stuttering due to navmesh updates
From Discord:
Hemaris — 07/30/2021
I get weird stuttering and a decrease from ~60 to ~35 FPS in the SHotN exterior cell Karthwasten, Docks on 0.47 RC6 but not 0.46. It appears to be AI related, because (1) it takes a few seconds after cell load for the slowdown to occur, and (2) FPS goes back up to ~60 with the tai command.
One unusual thing about the KW Docks is that there are two pathgrids right next to each other, one on each side of a cell boundary which cuts through the area.
elsid — 07/30/2021
It's not exactly AI related. It's navmesh generation that is constantly triggered by script-rotating objects (barrels, boats). It's not noticeable in vanilla locations because the amount of data to be processed is much less. Navmesh tiles have about 10k-24k triangles to be processed in Karthwasten, Docks. Usual vanilla tile (Seyda Neen, Balmora) has <2k triangles with average ~700.
This is caused by waiting on this lock in the main thread while background navmesh thread creates RecastMesh
holding the lock here.