Skip to content
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

Remove compression from terminal/monitor packets #1569

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

SquidDev
Copy link
Member

Minecraft already adds its own compression, so there's not much reason to do this. Well, I think - I need to test the effects of this change on a server.

@SquidDev SquidDev added enhancement An extension of a feature or a new feature. area-Minecraft This affects CC's Minecraft-specific content. labels Aug 23, 2023
@SquidDev
Copy link
Member Author

Okay, so set up a small testing grid here with 14 lots of 8x6 monitors, each at 0.5 times terminal size. The uncompressed packet here is a little over 26KiB.

With compression

The sent packets end up being compressed to 6KiB, which at 20Hz, would put as at around 1.6MiB/s.

The actual numbers I end up measuring from btop and nethogs are closer to 1MiB/s, so not entirely clear what's going on here. Unfortunately Minecraft doesn't expose any stats for compression by default, and I think adding them is going to be too much of a pain here.

Without compression

The sent packets are not compressed, and so we can see in JFR they take up 26KiB as expected. Compression clearly kicks in here, and measured network usage appears to be about 1.3MiB/s.

This is about 30% worse than the current state of things (i.e. with compression), but I think given the reduced CPU usage (no compression on the main thread) and complexity I think it's worth it.

@SquidDev SquidDev merged commit 500406f into mc-1.19.x Aug 27, 2023
6 checks passed
@SquidDev SquidDev deleted the feature/no-compression branch August 27, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Minecraft This affects CC's Minecraft-specific content. enhancement An extension of a feature or a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant