Recently I encountered HUGE lag on my 1.15.1 Paper server, I ran spark profiler and figured out it is because of villagers path- and goal-finding.
While I found several villagers farms on my server, I also had tick-inactive-villagers enabled.
Now I wonder, how does it work? Does it mean that server ticks all villagers on server?
My players also use /rtp a lot, is it related to villagers ticking? I thought that players may encounter a lot of villagers via using rtp, does server actually have some mechanism to optimize that or something?
After I disabled tick-inactive-villagers I have ~20 TPS in the same situation when I previously had ~13-15.
Now I think that if it is indeed the case I can write some plugin to manually track and refresh villagers trades when player interacts with them.
Just looking for some help from someone who knows Spigot/Paper internals.