InteractionVisualizer icon indicating copy to clipboard operation
InteractionVisualizer copied to clipboard

Better performance?

Open bobhenl opened this issue 4 years ago • 23 comments

Hi, I wanna report that I have some performance drop where was InteractionVisualizer mentioned too. Yes I know there are plugins that have bigger impact and I reported this to them too.

https://spark.lucko.me/#CSNSYiDThY https://spark.lucko.me/#MuzREldpav -> 5 minutes https://timings.aikar.co/?id=d7d5325a26f14d348f0559dc45bfe2ca

bobhenl avatar Mar 08 '21 00:03 bobhenl

According to the reports, InteractionVisualizer is just using 0.1-0.2% of the ticks, doesn't look like it is that laggy.

LOOHP avatar Mar 08 '21 06:03 LOOHP

Oh, I asked SLimefun dev about it and he responded me that:

InteractionVisualizer, CrazyEnchantments and Featherboard are partically high of usage too.

bobhenl avatar Mar 08 '21 08:03 bobhenl

What is the spec of your server?

LOOHP avatar Mar 08 '21 12:03 LOOHP

RAM: 6656 MB Intel l i9-9900k 3.6 GHz.

bobhenl avatar Mar 08 '21 12:03 bobhenl

https://timings.aikar.co/?id=a39b5c7f77ba4023bd74d72130d5f5a2 https://spark.lucko.me/#9Bd5VsrSdh

Again it seems to be so high by spark

bobhenl avatar Mar 10 '21 16:03 bobhenl

Perhaps try adjusting the refresh rate numbers in the config?

LOOHP avatar Mar 10 '21 17:03 LOOHP

https://pastebin.com/SST5W24g

bobhenl avatar Mar 10 '21 18:03 bobhenl

It looks like spark is running timings on async threads as well, those threads shouldn't hurt performance on the main thread that much tho, which probably explains why on the paper timings, InteractionVisualizer is not high, as paper timings only do timings on the main (synced) threads.

LOOHP avatar Mar 11 '21 16:03 LOOHP

So I shouldn't improve anything?

bobhenl avatar Mar 11 '21 16:03 bobhenl

I mean, if you are experiencing lag issue you should look at synced tasks.

LOOHP avatar Mar 11 '21 17:03 LOOHP

Mhm these yellow numbers indicate maybe something wrong. (the second most difficult plugin after STB, it's probably not good) https://spark.lucko.me/jVR0dR9UFo https://timings.aikar.co/?id=5ec98348c4254e7785e336982e76571b#plugins image

So what exactly do you suggest me to change here? https://pastebin.com/SST5W24g

bobhenl avatar Mar 12 '21 13:03 bobhenl

https://timings.aikar.co/?id=f38815f6b43549e9a0c3656042b81018 https://spark.lucko.me/PgpT340j4p image

This is a little bit weird, isn't something wrong with smoker? https://timings.aikar.co/?id=cbb85faa2edf4fc0be618353d81ca606#plugins image

bobhenl avatar Mar 13 '21 14:03 bobhenl

These timings are indeed very weird. The world is using 300% of a tick.

For the first picture, BeeNestDisplay (PlayerInteractEvent) is using 26%, but this is literally all it does

  1. Check a Enum value (event.isCancelled)
  2. Get the Block Object (not even creating a new object)
  3. Null check
public void onInteractBeenest(PlayerInteractEvent event) {
    if (event.isCancelled()) {
	return;
    }
    Block block = event.getClickedBlock();
    if (block != null) {
        //updateBlock(block) is not counted towards this method's execute time
	Bukkit.getScheduler().runTaskLater(InteractionVisualizer.plugin, () -> updateBlock(block), 1);
    }
}

It doesn't quite make sense. I'm not really sure why this is happening.

LOOHP avatar Mar 14 '21 09:03 LOOHP

And which values and to what do you suggest me to change?

bobhenl avatar Mar 14 '21 11:03 bobhenl

Perhaps try increasing the CheckingPeriods in the config? Honestly, I think the performance problem comes from something else. Perhaps your server is unable to handle that many worlds? Perhaps split them up into multiple servers?

LOOHP avatar Mar 14 '21 12:03 LOOHP

It's player worlds plugin. Mhm I'm not sure about it. Do you think that worlds are really the problem? But why is there your plugin marked mhm. Should I enable debug?

bobhenl avatar Mar 14 '21 12:03 bobhenl

Server slow down could also cause plugins to slow down. That might be the case as sometimes other plugins get marked as well.

LOOHP avatar Mar 14 '21 13:03 LOOHP

and about checking period, I can add it to all blocks?

And to which blocks do you suggest me to add/change it?

And which value? Now there's 20

bobhenl avatar Mar 14 '21 13:03 bobhenl

Increase them by 10 perhaps?

LOOHP avatar Mar 14 '21 13:03 LOOHP

And all of them? Even in blocks where it isn't yea?

https://timings.aikar.co/?id=15098fbb242645bca8d82df1d68d8760 image

And now there is brewing stand as high :/

bobhenl avatar Mar 14 '21 13:03 bobhenl

Give the latest build a try and see if it is better.

LOOHP avatar Mar 17 '21 04:03 LOOHP

image

https://spark.lucko.me/XDwmese8bY When you right click and choose this image

bobhenl avatar Mar 20 '21 20:03 bobhenl

Well, it's just 5% of a tick for every 10 ticks. I guess what you could do is check the light update period in the config from 10 to 20 perhaps.

LOOHP avatar Mar 21 '21 06:03 LOOHP