dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inefficient Async Packet Processing Sequence

Ingrim4 opened this issue · comments

When a packet is intercepted, it is first processed by all sync packet listeners and then by async ones. The AsyncMarker is used to send the packets once they have been processed by all async packet listeners. After this, the process jumps back to the main thread to invoke MONITOR listeners, which might not even exist. This seems inefficient since the sync monitor listeners have already been invoked and do not require invocation again. To improve efficiency, I propose changing this behavior to always notify the injector directly once a packet is done processing.

Should improve/solve #2549