Skip to content

fix(spawning): coalesce and gate WorldSpawnManager environment recalcs#25

Merged
Xytronix merged 1 commit into
IroriPowered:pre-releasefrom
Xytronix:perf/spawn-manager-recalc
May 29, 2026
Merged

fix(spawning): coalesce and gate WorldSpawnManager environment recalcs#25
Xytronix merged 1 commit into
IroriPowered:pre-releasefrom
Xytronix:perf/spawn-manager-recalc

Conversation

@Xytronix
Copy link
Copy Markdown
Collaborator

Summary

WorldSpawnManager.onEnvironmentChanged() schedules a environment recalc for every world on every call, these are about 40000 unnecessary recalcs on a 29 world server with each using 40-70ms of tick time.

O(worlds² × roles) is suboptimal, this Mixin only queues one recalc per world at a time.

Related issues

2026/05/28 03:47:15   WARN]         [World|Arena4] Task took 62ms 334us 470ns ns: com.hypixel.hytale.server.spawning.world.manager.WorldSpawnManager$$Lambda/0x0000000043f6cc00@1c1a50b9

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (requires documentation/migration)
  • Chore / refactor
  • Documentation only

Implementation details

  • MixinWorldSpawnManager skip worlds where WorldConfig.isSpawningNPC() is false and patches absurd recalc logic of O(worlds² × roles) to only do one recalc per world

Checklist

  • Code compiles successfully
  • Pull request does not contain unrelated changes
  • Changes follow this project's code style (Use spotlessApply when necessary)
  • Changes are tested or will be tested after submission

@Xytronix Xytronix merged commit 8c0b177 into IroriPowered:pre-release May 29, 2026
1 check passed
@Xytronix Xytronix deleted the perf/spawn-manager-recalc branch May 29, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant