Scyntrus / FactionMobs

FactionMobs CraftBukkit Plugin
http://dev.bukkit.org/server-mods/faction-mobs/
Other
14 stars 19 forks source link

Potential Performance Issue #30

Open SydMontague opened 4 years ago

SydMontague commented 4 years ago

My timing reports identify Task: EntityListener$$Lambda$4222/471528072(Single) as a task that takes up a large part of it's tick. While it's total impact on the server is relatively small this can still cause small lag spikes when the task runs.

Looking at the code it seems like this corresponds to this line. This seems to update every FactionMob every time any entity dies, which appears to me to be quite wasteful given that most of the time the update is unnecessary.

-> shouldn't is be more effective to only do that call when a FactionMob dies or, alternatively, based on a timer?