-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Implement Bulk Loading/Writing for Chunks #535
base: master
Are you sure you want to change the base?
Conversation
…ment and use exception to know if file exist
…improved usability
… and adjust file truncation logic
… in LinearFile and tmp filenames on write
… management logic
pub enum Compression { | ||
/// GZip Compression | ||
GZip = 1, | ||
/// ZLib Compression | ||
ZLib = 2, | ||
/// Uncompressed (since a version before 1.15.1) | ||
#[default] | ||
Uncompressed = 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this, We had this before already. But it actually makes no sense to have "No Compression" in an Compression enum, Also now we have to use convert the input data to vec when uncompressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem to let it as before but, if the code 3
exists and means something specific, even documented officially (https://minecraft.wiki/w/Region_file_format). Dont we should have it well represented on code? this way we dont need to manage where we use the compression struct. And also NoCompression
can be a "zero runtime cost but no memory footprint improve version". Whatever you choose its good for me, i just thought it was desirable.
This PR implement the Bulk API for chunks loading/writing with some function changes that get leverage of the bulk operation (like reducing allocations, locks and more).
Also this includes some Anvil refactor and the creation of a Traits/API that can be re-used on entity storage system and to implements diferents Writers/Loaders (as DB cached, one that use in Cloud Storage or more optimizations).