Lag with Phosphorus lamp handler
LemADEC opened this issue ยท 6 comments
Describe the bug
Whenever an mob is spawning, the mod check all blocks around for a phosphorus lamp. When said lamp is nest to a Vanilla spawner block, the latest keeps on trying to spawn mobs, causing lag. Here's a profiling result from a single spawner:
Consider caching the lamp coordinates to avoid scanning the whole area each time a mob tries to spawn.
To Reproduce
Steps to reproduce the behavior:
1- Find a natural vanilla spawn room
2- Place a phosphorus lamp inside a wall
3- Profile
Versions:
- Metallurgy 4: Reforged: Reforged: Reforged: 0.2.2
- Forge: 14.23.5.2838
- Minecraft: 1.12.2
- Modpack: small custom modpack
- Conflicting mod : none?
- Other mods you think could cause issues:
this was measured on SpongeForge dedicated server (1.12.2-2838-7.1.7-RC3841).
Additional context
Issue isn't reproduced when the lamp is removed since the spawner is on cooldown at that point.
they're not talking about fps drops @HurtsAsHell
out of curiosity, what's the profiler you're using to scan for methods leaking on performance? @LemADEC
That one is from Spark, you can get the Forge version here: https://ci.lucko.me/job/spark/
Acquire 5 mn to get a decent result with /spark start -timeout 300
. It'll give you a link at the end to the result page. Remember to select the MC version before opening the tree.
You might want to amplify the results to more easily catch the lag sources in your code (imagine what 50 players online at the same time would do).