Level icon indicating copy to clipboard operation
Level copied to clipboard

Performance issue with tops

Open HamtaBot opened this issue 1 year ago • 8 comments

Expected behavior

no server freeze when fetching island top and island bank top

Observed/Actual behavior

reading this spark with only-tick-over 80 showed me why my server sometimes freeze for a few ticks, according to the spark report here https://spark.lucko.me/wc2Rinlm17 getting the top bank and top island level make the server freezing i have holograms that display those top this is why its showing under CMI:hologram

Steps/models to reproduce

i'm not sure if this is because if have a lot of players and data but get a few people online and load and unload an hologram with the tops it should show on spark

BentoBox version

bbox version [14:14:14 INFO]: Serveur Invalide (UNIVERSESPIGOT) 1.20.1. [14:14:14 INFO]: Version de BentoBox : 1.24.1-SNAPSHOT-b2435 [14:14:14 INFO]: Base de données : MARIADB [14:14:14 INFO]: Mondes de jeu chargés : [14:14:14 INFO]: oneblock_world (OneBlock) : Overworld [14:14:14 INFO]: Addons chargés : [14:14:14 INFO]: AOneBlock 1.14.1 (ENABLED) [14:14:14 INFO]: Bank 1.7.0-SNAPSHOT-b83 (ENABLED) [14:14:14 INFO]: Biomes 2.2.0-SNAPSHOT-b251 (ENABLED) [14:14:14 INFO]: Chat 1.1.4 (ENABLED) [14:14:14 INFO]: ControlPanel 1.13.1-SNAPSHOT-b61 (ENABLED) [14:14:14 INFO]: Level 2.11.0-SNAPSHOT-b541 (ENABLED) [14:14:14 INFO]: Likes 2.4.0-SNAPSHOT-b97 (ENABLED)

Plugin list

No response

Other

No response

HamtaBot avatar May 03 '24 12:05 HamtaBot

@BONNe This is probably due to head getting, right?

tastybento avatar May 03 '24 19:05 tastybento

Hmm, player heads were async for a while, however, due to bukkit enforced "better" skull setter, it may be that it is a reason for a lag. But that would be a bukkit thing.

BONNe avatar May 03 '24 20:05 BONNe

so you telling me bukkit has to fix it ? xD Can i disabled this heads things ? i'm using a complete external menu for tops and there is no heads on it

HamtaBot avatar May 04 '24 00:05 HamtaBot

Hmm, then head getter should not be an issue. It is triggered only on BentoBox menus with custom heads. If the menu is not from BentoBox, then I do not think it is BentoBox that causes issue.

BONNe avatar May 04 '24 07:05 BONNe

Hmm, then head getter should not be an issue. It is triggered only on BentoBox menus with custom heads. If the menu is not from BentoBox, then I do not think it is BentoBox that causes issue.

check the spark report , its showing under my holgrams and placeholder API so i'm guessing it has to do with top placeholders , maybe they are triggering the skin thing

HamtaBot avatar May 04 '24 12:05 HamtaBot

starting from here its bentobox code image

HamtaBot avatar May 04 '24 12:05 HamtaBot

No, it is not head related. The issue is that it calculates order each time placeholder is generated and it may be the issue for the 'lag'

BONNe avatar May 04 '24 13:05 BONNe

Tasty, I think you need top to be sorted only once and continuously maintain it, instead of sort it every time method is requested

BONNe avatar May 04 '24 13:05 BONNe

@HamtaBot Can you try to latest CI build and see how it works for you? I tried a few approaches.

tastybento avatar May 04 '24 19:05 tastybento

@HamtaBot Can you try to latest CI build and see how it works for you? I tried a few approaches.

can i use it with my actual setup without having to upgrade all addons and bentobox ? i'm using the last bento version compatible for 1.20.1

HamtaBot avatar May 04 '24 21:05 HamtaBot

Yes, it should be fine but let me do a proper release if you are concerned.

tastybento avatar May 05 '24 18:05 tastybento

Yes, it should be fine but let me do a proper release if you are concerned.

alright

HamtaBot avatar May 05 '24 18:05 HamtaBot

after some testing it completly fixed freeze and bentobox isnt showing anymore on tick over 80

HamtaBot avatar May 06 '24 17:05 HamtaBot

Fantastic.

tastybento avatar May 06 '24 18:05 tastybento