Skip to content

Conversation

@gibsonpil
Copy link

@gibsonpil gibsonpil commented Jan 13, 2025

This pull request is intended to backport some of the improvement made to chunk compression in newer updates and also introduce some new ones.

Todo List:

  • Allow setting the world compression type (backport from 24w04a).
  • Allow disabling world compression.
  • Add lz4 support (backport from 24w04a).
  • Add xz support.
  • Allow switching block ordering from XZY to YZX (backport from Anvil).
  • Add support for immediately resaving chunks with these changes applied.

I've also generated (unscientific) benchmarks by regenerating a world with the same seed, immediately exiting the server, and marking down the file size generated by each compression type. I will write a proper, scientific benchmark later.

Unscientific Benchmarks:

Format Compression Ratio
none 1
gzip ~0.0539
deflate ~0.0533
lz4 ~0.0672
xz ~0.0238

EDIT: Dropped idea of adding ZSTD support. It doesn't have a Java native version compatible with Java 1.8, and bundling a native version to use with the JNI would just overcomplicate things.

EDIT 2: Ran some benchmarks and decided XZ would be an appropriate substitute for ZSTD.

@RhysB RhysB added the enhancement New feature or request label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants