(Minor?) Performance issues with excrement configuration, poisonous libelle
noobanidus opened this issue ยท 2 comments
I just want to preface it with what an awesome and amazingly thematic mod you have! I've really been enjoying my play-through of it on my private multiplayer server.
I'm filing this issue here as the former is primarily an issue not with (from what I can tell) CyclopsCore, but its use with EvilCraft itself. This is predicated on the understanding that, while I am quite new at understanding VisualVM and sampler combined, a friend has been helping me try to track down sources of lag on my multiplayer server.
This is not a major source of lag (that was potentially the Discord Integration I was using), but there were two things that stood out to him that I thought you might like to be aware of:
Issue type:
- ๐ EvilCraft appears to be calling
Class.searchFields
for every entityLivingUpdateEvent
. From what I can gather, this is a result of the config look-up to determine is excrement is enabled. The code itself appears to be fine when used normally, but as the consultation is done per-tick, and the configuration value doesn't change per tick, it could be as simple a fix as caching the value statically and accessing that. - ๐ Additionally, the Poisonous Libelle appears to be using
Random.nextGuassian
on every tick (while I haven't even found a single one on the server yet!) which my friend said was "quite expensive". To be honest, I don't fully comprehend how to gauge "expensiveness" based off of profiles as of yet, but I am trying to learn!
Short description:
Here is the breakdown for the excrement configuration:
Here's the breakdown for the poisonous libelle:
Please note that I'm not entirely sure which samples these were from and what the sample periods were. If you are interested I have attached some of the samples to this bug report. I can't tell you for certain how large a period they were over, but you might be able to make more out of them: Instances.zip
Steps to reproduce the problem:
- Simply run the game.
Versions:
- This mod: 0.10.70
- Minecraft: 1.12.2
- Forge: 2815
Profiler output:
Please see the above linked: Instances.zip
Finally, again, I don't know how to quantify how major or minor these performance issues are, and based on the period of time the samples were done over, how to quantify it within each individual sample. I've provided you with all the ones I took, however, so you can have a complete & broad picture.
Thanks for an awesome mod!
No worries! Yes, it does appear to be related, however, instead of just being relegated to the initial config load, it's happening every tick, so it's having a little more of an impact. Not a huge one.
I'm glad the report was sufficient. I'm still learning VisualVM myself and am mostly relying on a friend for this, and I felt a responsibility to pass on as much information as I could about it.
Thanks for the detailed report! I'll see what I can do about the issues.
this is a result of the config look-up to determine is excrement is enabled.
This seems to be related to CyclopsMC/CyclopsCore#116
the Poisonous Libelle appears to be using Random.nextGuassian on every tick
Not sure why I'm using that method, perhaps some improvements are impossible indeed.