ProtocolLib icon indicating copy to clipboard operation
ProtocolLib copied to clipboard

Inefficient Async Packet Processing Sequence

Open Ingrim4 opened this issue 1 year ago • 0 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

Ingrim4 avatar Jun 20 '24 23:06 Ingrim4