Skip to content

Inefficient dragon respawn #10323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2stinkysocks opened this issue Mar 14, 2024 · 1 comment · May be fixed by #12351
Open

Inefficient dragon respawn #10323

2stinkysocks opened this issue Mar 14, 2024 · 1 comment · May be fixed by #12351

Comments

@2stinkysocks
Copy link

2stinkysocks commented Mar 14, 2024

Timings or Profile link

https://spark.lucko.me/yEwDSXG6Yk

Description of issue

After placing the fourth end crystal when respawning the ender dragon on the latest version of paper with only spark installed, a lag spike happens from the method net.minecraft.world.level.dimension.end.EnderDragonBattle.findExitPortal(). The timing link has a threshold of 100ms per tick, so it only captured the tick where the spike occurred.

Plugin and Datapack List

plugins
[17:14:22 INFO]: Server Plugins (1):
[17:14:22 INFO]: Bukkit Plugins:
[17:14:22 INFO]: - spark
datapack list
[17:14:24 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[17:14:24 INFO]: There are no more data packs available

Server config files

https://paste.gg/p/anonymous/64cefa9fd53943738dae4a435cce823f
https://paste.gg/p/anonymous/535e23161f594ff5a7d89aba428eaf7b
https://paste.gg/p/anonymous/1368ee80df46428680618c1cf190d2cf
https://paste.gg/p/anonymous/6c773eff0b734515b7715b995e545577
https://paste.gg/p/anonymous/c35ba578670e488db1fbf0882ebd1a33

Paper version

version [17:13:40 INFO]: Checking version, please wait... [17:13:41 INFO]: This server is running Paper version git-Paper-450 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 62b220a) You are running the latest version Previous version: git-Purpur-2155 (MC: 1.20.4)

Other

After testing, the lag spike is caused by the server checking for the end portal formation from the highest placed block at 0,0 to the bottom of the world in a single tick, which takes longer than 100ms (usually anywhere from 800-2500). I think major refactoring might have to be done to fix this, although just making the search algorithm more efficient could also be an easier fix.

@2stinkysocks 2stinkysocks changed the title Lag spike on dragon spawn Inefficient dragon respawn Mar 20, 2024
@kashike kashike added the version: 1.20.4 Game version 1.20.4 label Apr 28, 2024
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue Mar 27, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
@AfonsoMendoncaJacinto
Copy link

AfonsoMendoncaJacinto commented Mar 27, 2025

Good afternoon (at least where I live). I believe this patch fixes this issue smoothly, without affecting gameplay negatively, on the contrary. Me and my colleague have tested this thoroughly and found no game-breaking behaviour. Please let me know, in case there is anything out of the ordinary.

AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue Mar 28, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue Mar 28, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue Mar 28, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue Mar 28, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
@Warriorrrr Warriorrrr linked a pull request Mar 29, 2025 that will close this issue
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue May 1, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue May 2, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
AfonsoMendoncaJacinto added a commit to AfonsoMendoncaJacinto/Paper that referenced this issue May 2, 2025
This issue likely arose from the method findExitPortal(),
which has been optimized. This optimization will ensure
better server performance during the respawn sequence
and smoother gameplay.

Signed-off-by: Afonso Jacinto
<[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants