Skip to content

Compact encoding for strings #4

@SergeyKanzhelev

Description

@SergeyKanzhelev

Originally from @yurishkuro

#2 (comment)

Strings are transmitted in ASCII encoding.

Is it a requirement that keys and values must be represented in ASCII? The example below could encode 34f067aa0ba902b7 as 8 bytes instead of 16 ASCII characters, but in this case an instrumentation that transfers the context from text protocol to binary protocol would need to know somehow which vendor values are actually hexadecimal representations, which doesn't sound like something we want.

{ 0,  3,  102, 111, 111,  16,  51, 52, 102, 48, 54, 55, 97, 97, 48, 98, 97, 57, 48, 50, 98, 55,
 0,  3,   98,  97, 114,  4,   48, 46, 50, 53,  }

This corresponds to 2 tracestate entries:
foo=34f067aa0ba902b7,bar=0.25

If we say that keys/values must indeed be ASCII strings, then it makes me question why we need binary encoding at all, since it does not provide any compression. It might be slightly faster to parse since the sizes are explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions