crashtheparty / EnchantmentSolution

Enchantment plugin for Custom Enchantments.
15 stars 14 forks source link

[2.2 pre3 1.15.1]Height++ and Width++ levels higher than II cause performance issues. #50

Closed DXUltimate closed 4 years ago

DXUltimate commented 4 years ago

https://www.youtube.com/watch?v=oArW_Q2FP3o

Not sure what else to say about that,

crashtheparty commented 4 years ago

Each block break event takes around 1/3 to 1/2 of a millisecond to process on my test server, which has only me in it. with Height++ 3 and Width++ 3, you are breaking 81 blocks in a tick, so 80 * 1/2 is 40 milliseconds to process those values. The server, at best case, should be running at 20 tps. Each tick would be 50 milliseconds. Therefore, using Height++ 3 and Width++ 3 together would take up 80% of a tick, which will obviously slow down the server a lot. Add in higher values than that and you definitely have a problem. Imagine how much strain 80 people all break blocks on a server at once takes up on the server; that's how much one person takes when using that kind of pickaxe takes up on the server. Unless Minecraft or Spigot can increase the performance significantly, I doubt there's a way to change this.

However, through my testing of this, I found another bug, so I thank you for sending in the ticket anyway.

DXUltimate commented 4 years ago

Yeah.

Admittedly, it wasn't taking that long to process in 1.14.4 builds say, version 2.1.X in paper-83 1.14+, so it's possible they decreased performance with the update to 1.15+

Thanks for your hard work friend. =)

Onyxtite commented 4 years ago

While implementing alternative solutions might be tricky (depending on which is taken) its totally possible to avoid this lagg, with nms, or at least preventing light and physics updates. 81 blocks might sound like much, but its really nothing in the grand scheme of performance, if done the right way.

crashtheparty commented 4 years ago

I modified the performance a little bit before the final version, so it should be better in 2.2.0, but it still can lag your server a lot with very high levels of both.