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

Denser length encoding as an option #3

Open
tv42 opened this issue Sep 26, 2015 · 1 comment
Open

Denser length encoding as an option #3

tv42 opened this issue Sep 26, 2015 · 1 comment

Comments

@tv42
Copy link
Member

tv42 commented Sep 26, 2015

We could encode field lengths at <1byte per field.

This could be enabled on a {message,version}-basis in the schema with e.g.

message Person v1 {
    wire format: v1
    options {
        align: 4
        # switches field lengths from varuint to exponential golomb coding
        field length encoding: exp-golomb
    }

    slots {
        ...
  • they're not sorted, so can't delta-compress, but could bit pack

Resources

self-delimiting number sequences

  • goal: "Field lengths are densely encoded, typically at less than 1 byte per field."

Elias δ-coding needs

math.floor(math.log(x, 2)) + 2 * math.floor(math.log(1 + math.floor(math.log(x, 2)), 2)) + 1

bits to encode x

Results from my experiments so far

tv42 added a commit that referenced this issue Sep 26, 2015
It's just confusing here in the schema example. Created
#3 instead.
@tv42
Copy link
Member Author

tv42 commented Oct 7, 2015

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

No branches or pull requests

1 participant