ProtocolLib

3M Downloads

"PacketContainer.deepclone()" is heavy

WarnDa opened this issue ยท 3 comments

commented

Describe the bug
I'm using latest dev build of protocollib, and chat packets are heavy

To Reproduce

  1. Use a plugin that send messages to one player using "player.sendMessage"
  2. send a lot of message (1-2 per second)
  3. do a spark

Expected behavior
Should be less heavy, is this planned for a recode/optimisation in your V5 ?

Screenshots
image

Version Info
Provide your ProtocolLib install info with /protocol dump through pastebin.
https://pastebin.com/hrwBJhAJ

Additional context
The spark : https://spark.lucko.me/9orqLFS8bB

commented

First of all it is not a fault of ProtocolLib, InteractiveChat is deep cloning the packet. Second: there is no real way to improve the performance of that - we need to create a fresh copy of the object and as java has no fast path for that implemented (yet ๐Ÿ™ ) thats the only way we can do it...

commented

Doesn't look like the server is struggling or close to struggling because of that 0.35% caused by cloning chat packets for fallback use. (There are a surprising amount of illegal chat json strings sent by pluigns believe it or not)

commented

Okay thanks for your answers, I was hopping there could be changes to reduce it, but not currently, so I'm closing this :c