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

Use zig zag encoding for the chunk x/z ints #3

Open
mworzala opened this issue May 31, 2023 · 0 comments
Open

Use zig zag encoding for the chunk x/z ints #3

mworzala opened this issue May 31, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mworzala
Copy link
Contributor

VarInts are not great for negative twos-complement ints. It would generally be an improvement to zig zag encode those, though it will be a minor difference.

For example, saving 4 chunks around 0-0, there would be 64 coordinates saved. Using ints this would be 32*4 = 128 bytes. Using VarInts the positive ones would be 1 byte, negative ones would be 5 bytes, so 16*1 + 16*5 = 81 bytes. Using zig zag encoding + var ints it would be 1 byte for each value, so 32 bytes.

@mworzala mworzala added enhancement New feature or request good first issue Good for newcomers labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant