ProtocolLib

3M Downloads

Strong server lag and crashes

nf-projects opened this issue ยท 5 comments

commented

Describe the bug
Hello, I'm experiencing lots of performance issues with Protocollib & EcoEnchants (which relies on protocollib). My server is running pufferfish-1.18.2 with about 50 players online (has handled 130+ without issues) and is going down to 10-15TPS and then crashes. Here's a spark: https://spark.lucko.me/5d339l9X2I

To Reproduce
Steps to reproduce the behavior:

  1. Install protocollib, eco, ecoenchants, and spark on a pufferfish-1.18.2 server
  2. /spark profiler, wait, /spark profiler --stop
  3. Watch your server lag & crash

Expected behavior
That the server doesn't crash and lag

Screenshots

Version Info
https://paste.gg/p/anonymous/2281ad1231934bb7a5492ca69ee283a8
(at this point, I already disabled eco and ecoenchants to make the server semi-playable)

commented

This seems to be an issue with the eco plugin by willfp (the plugin is deep-cloning all WindowItem packets which is very slow).

commented

@derklaro I actually initially reported it to that plugin's developer, but they said "it's protocollib itself that's broken here" and told me to report it here.

commented

Well you can say that somewhat, but the real issue is caused by him deep-cloning the packet. Cloning is a very heavy operation due to jvm limitations, and doing it for each window item packet is quite often. In a lot of cases cloning the packet is not needed, and the fields in the packet should rather be modified directly.

I mean yes, the issue comes from ProtocolLib, but just because his plugin forces us to execute heavy operations (which we cannot control) rather than using the api appropriately.

commented

I've forwarded a screenshot of your comment to the plugin developer, thanks.

commented

Yeah there's only so much we can do to optimize what is probably the most intensive operation you can do with PL. Oracle and co also seem to have a vendetta against reflection so I don't see that getting better any time soon