Metallurgy 4: Reforged

Metallurgy 4: Reforged

438k Downloads

Lag with Phosphorus lamp handler

LemADEC opened this issue ยท 6 comments

commented

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:
image

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

Screenshots
image

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

public static void denySpawn(LivingSpawnEvent.CheckSpawn event)

commented

Issue isn't reproduced when the lamp is removed since the spawner is on cooldown at that point.

commented

IDK :/
2019-07-16_20 06 20

commented

they're not talking about fps drops @HurtsAsHell

commented

I think I didn't understand then, then explain to me on discord

commented

out of curiosity, what's the profiler you're using to scan for methods leaking on performance? @LemADEC

commented

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).