Slow access to configuration values
LemADEC opened this issue ยท 4 comments
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:
- 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:
ID and EC will have to be updated as well when a new version is released for this change to have effect.
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
CyclopsCore - Minecraft library mod for EvilCraft, Integrated Dynamics and others.
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.