-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Originally from @yurishkuro
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.