-
-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass compressed packets directly to the backend server/client #1078
base: dev/3.0.0
Are you sure you want to change the base?
Pass compressed packets directly to the backend server/client #1078
Conversation
This has been proposed many times. By all means, this is not a bad idea. My main concern is that it could introduce overhead from decompressing to check the packet ID. zlib decompression is actually really cheap, the actual CPU-intensive part is compressing the packet. Personally, I would rather have Mojang pull out the packet ID from compressed packets, but the window to do that was in 2013 and that's well past us now. |
…d-packets-to-backend # Conflicts: # proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java # proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/MinecraftCompressAndIdDecoder.java # proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java
Wouldn't that still be faster than recompressing every packet? |
Compressing small packets is still pretty cheap. Could we have a carveout for packets with a compressed size lower than, say, 2048 bytes? Larger packets will benefit from this much more than smaller packets. |
Maybe make a configurable amount |
This passes compressed packets that are not present in the packet registry to the backend server/client without decompressing/recompressing them whenever possible; only the first 5 bytes are decompressed to get the packet id.