Excessive calls to RegistryKey.getOrCreateKey from DimPos cause immense lag
DBotThePony opened this issue ยท 4 comments
Issue type:
- ๐ Performance issue
Short description:
DimPos.isLoaded()
call down to RegistryKey.getOrCreateKey
, which call String.intern()
, which is utterly slow
You might notice that first trace has AE2 in it and discard report that it is caused by AE2. But it is not. E.g. for example, if you crouch with The One Probe installed and look at crafting interface, entire server will freeze for several seconds (the bigger is item network the longer will be the freeze), because it want to display some of items in tooltip. "Freeze" doesn't happen when you crouch look at enormous colossal chest for example, containing all the items exposed by ID network. And DimPos
will be the king in sampler report.
Steps to reproduce the problem:
- Have something that use DimPos (e.g. IntegratedDynamics)
- Enjoy
onPostServerTick
take more than half of tick time.
Versions:
- This mod: 1.16.5-1.11.5
- Integrated Dynamics: 1.16.5-1.7.1
- Minecraft: 1.16.5
- Forge: 1.16.5-36.1.4
Profiler output:
Here is sampling file for over 7 hours of server runtime: cyclops_longer_profile.zip
Forgot to mention that server is running under Linux Ubuntu Server 20.10, kernel version 5.9.1-050901-generic, Minecraft Server itself is running under GraalVM 21.0.0.2 (which is faster than regular HotSpot JVM).
Since some mods seem to perform much worse under Linux until getting performance fixes, I am making sure you can reproduce the problem and implement fixes (you can easily setup Linux under VirtualBox, performance of console apps under VirtualBox are very close to bare metal).
Please look into this as soon as possible, because it is the only slow part about Integrated Dynamics (excluding NBT comparisons) and it tank performance of server no matter how complicated ID networks are.