Talia-12 / Hexal

Extension mod for Hex Casting to add new patterns (and whatever else I feel like).
MIT License
13 stars 21 forks source link

TickingWisp.wispContainsPlayer() is causing performance issues #64

Closed computer-whisperer closed 1 year ago

computer-whisperer commented 1 year ago

https://spark.lucko.me/DYhQALuhiz

My personal server has slowed down to 8tps recently, and this profile seems to indicate that 58% of the tick time tends to come from TickingWisp.wispContainsPlayer() alone.

Seen with the modpack "All of Fabric 6" version 1.5.4. Minecraft 1.19.2, Hex Casting 0.10.3 Hexal 0.2.14, Fabric API v0.76.0+1.19.2

computer-whisperer commented 1 year ago

To fix the performance problem for my personal server I modified TickingWisp.wispContainsPlayer() to just return false, and that alone has taken my server from 110 ms per tick down to 24 ms per tick. Caching the "contains player" state will probably help, but I expect that there is a much deeper problem if simply checking that a wisp spell contains a player every tick is that taxing.

computer-whisperer commented 1 year ago

This should be fixed now that #73 is merged.