Skip to content

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

@mworzala

Description

@mworzala

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions