-
Notifications
You must be signed in to change notification settings - Fork 73
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
Question about char
encoding
#63
Comments
That's a good question! The answer is probably "I didn't think of that"! Originally, I think I might have sent the whole [u8; 4], and at the time when I switched to "as a string" encoding, varints were limited to enum discriminants and slice lengths. It didn't occur to me to switch it to a It certainly would be possible to make a Closing this as resolved, but feel free to re-open if there are any follow-ups! |
I was just running some benchmarks and noticed that this crate not only uses UTF-8 char encoding but stores an additional "length" field to count the bytes in the char. The length is implicit in the first UTF-8 byte, so it could be omitted. Chars are probably rare, but this could make common chars twice as small. |
Hey @finnbear, congrats on releasing bitcode :) There are definitely better ways to encode I think either edit: opened as #101. |
According to the new wire format spec:
I was curious about the choice of this encoding versus encoding a
varint(u32)
encoding, which seems like it would be more compact on average.The text was updated successfully, but these errors were encountered: