Skip to content

Add LZ4 support for region files#2376

Closed
egg82 wants to merge 1 commit into
PaperMC:ver/1.14from
egg82:feature/lz4
Closed

Add LZ4 support for region files#2376
egg82 wants to merge 1 commit into
PaperMC:ver/1.14from
egg82:feature/lz4

Conversation

@egg82
Copy link
Copy Markdown
Contributor

@egg82 egg82 commented Jul 27, 2019

Using lz4-java: https://github.com/lz4/lz4-java
There's a new option in PaperConfig for this which defaults to false.
Since the patch hooks Mojang's versioning system for new compression methods, it
should be internally consistent, easily-updatable, and reversible with a force-upgrade.

This will likely conflict with plugins and programs expecting region files to be compressed using the current standard.

@Spottedleaf Spottedleaf mentioned this pull request Jul 27, 2019
10 tasks
@egg82
Copy link
Copy Markdown
Contributor Author

egg82 commented Jul 27, 2019

Zstd PR here: #2377
Note that LZ4 is optimized for decompression, where Zstd is optimized for compression.

+ // Paper start - LZ4 support
+ if (PaperConfig.useLZ4Compression) {
+ try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new net.jpountz.lz4.LZ4FrameOutputStream(new java.io.FileOutputStream(file)), 32 * 1024))) {
+ NBTCompressedStreamTools.writeNBT(oversizedData, out);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a return statement here

@egg82
Copy link
Copy Markdown
Contributor Author

egg82 commented Aug 3, 2019

Closed in favor of #2377 which has this and is more complete.

@egg82 egg82 closed this Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant