"PacketContainer.deepclone()" is heavy
WarnDa opened this issue ยท 3 comments
Describe the bug
I'm using latest dev build of protocollib, and chat packets are heavy
To Reproduce
- Use a plugin that send messages to one player using "player.sendMessage"
- send a lot of message (1-2 per second)
- do a spark
Expected behavior
Should be less heavy, is this planned for a recode/optimisation in your V5 ?
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
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...
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)