[WIP] Dynamic compression for world data - #90
Open
RecursivePineapple wants to merge 7 commits into
Open
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chunk/cube saving unconditionally uses GZIP for compression currently. This PR adds the ability for data to be compressed with different algorithms. Currently, only LZ4 is implemented. LZ4 was chosen because it is extremely fast, which eliminates most overhead when loading or saving world data. The algorithm is configurable so that server owners can tweak it or disable it entirely. The compression level can be changed at-will, and the world will be re-compressed with the new format as chunks and cubes are re-saved. I will also add something that re-compresses rarely used chunks/cubes when players haven't visited them in several IRL days.
LZ4 compression was also added to cube data, since CC was uploading over 10MB/s to players as they moved. This should significantly reduce network usage while keeping overhead low. We previously used GZIP to compress packets, but its overhead made the game unplayable.
Checklist