hpfxd / PandaSpigot

Fork of Paper for 1.8.8 focused on improved performance and stability.
GNU General Public License v3.0
238 stars 65 forks source link

LazyRunnable is deprecated #145

Closed MachineBreaker closed 1 year ago

MachineBreaker commented 1 year ago

Type check vs LazyRunnable receive an always-on performance hit for a common operation that users shouldn't pay if they won't use it.

https://github.com/netty/netty/commit/de876d197a945e2b3a4a96b90a65c00611b77806

andreasdc commented 1 year ago

You can report it to Paper too https://github.com/PaperMC/Paper/blob/master/patches/server/0710-Optimise-non-flush-packet-sending.patch

MachineBreaker commented 1 year ago

I didn't find the related patch in Paper so i reported it here, gonna do it later

andreasdc commented 1 year ago

You didn't report it?

andreasdc commented 1 year ago

This may be really useful to fix, because with the latest netty I think it removes LazyRunnable from working completely.

MachineBreaker commented 1 year ago

LazyRunnable shouldn't be added again unless you workaround the JDK-8180450 bug. This indeed makes packet writing slow (from 880ms to 1450ms)

andreasdc commented 1 year ago

LazyRunnable shouldn't be added again unless you workaround the JDK-8180450 bug. This indeed makes packet writing slow (from 880ms to 1450ms)

I think you should report it to netty then, this feature is still available, but in a different method.

MachineBreaker commented 1 year ago

LazyRunnable shouldn't be added again unless you workaround the JDK-8180450 bug. This indeed makes packet writing slow (from 880ms to 1450ms)

I think you should report it to netty then, this feature is still available, but in a different method.

Netty already provided a solution, not my job to implement it

andreasdc commented 1 year ago

What solution?

MachineBreaker commented 1 year ago

What solution?

Override SingleThreadEventExecutor#wakesUpForTask I also fixed it directly on my netty fork without getting the always-on performance hit but yeah, there's no way to use it here