Cyclops Core

Cyclops Core

93M Downloads

Slow access to configuration values

LemADEC opened this issue ยท 4 comments

commented

Issue type:

  • ๐ŸŒ Performance issue

Short description:

Configuration values aren't cached, causing CPU load.
Also, it appears fields lookup also involved, which is naturally slow.

Consider caching configuration values.

Steps to reproduce the problem:

  1. profiling a server with 20+ players online.

Versions:

  • This mod: 1.12.2-0.11.8
  • Minecraft: 1.12.2
  • Forge: 14.23.4.2756

Profiler output:

image

commented

ID and EC will have to be updated as well when a new version is released for this change to have effect.

commented

0.13% of your tick time is not very significant. There is likely to be a bunch of other stuff that can be optimized more significantly.

But nevertheless, I could indeed some caching to optimize this.

Relevant code: https://github.com/CyclopsMC/CyclopsCore/blob/master-1.12/src/main/java/org/cyclops/cyclopscore/config/ConfigHandler.java#L237

GitHub
CyclopsCore - Minecraft library mod for EvilCraft, Integrated Dynamics and others.
commented

0.13 % for a disabled feature is a lot when comparing to 0.05 % for an enabled feature from other mods.
When you've 140 mods involved, small things are adding up quickly :).

Total contribution for this specific method is 0.24% splitted in 6 different locations.

commented

Sure, you're right. I'm just saying that there's a bunch of issues on my todo-list that cause a significantly larger performance problem, so I'd like to prioritize those :-)

But if you're up for it, PRs on this are welcomed! ;-)