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

Consider adding enum metadata to typed map schemas #83

Open
davidmorgan opened this issue Oct 2, 2024 · 0 comments
Open

Consider adding enum metadata to typed map schemas #83

davidmorgan opened this issue Oct 2, 2024 · 0 comments

Comments

@davidmorgan
Copy link
Contributor

If we end up using enums a lot, it might be useful to switch the binary format from the current string-based encoding to an index-based one.

To be backwards/forwards compatible, the index does still need to link back to strings. This can be done by including the strings in the typed map schemas.

So: before this change, enum values end up written out as pointers to strings: four bytes. After this change, they end up written as known-sized integers, which be very tightly packed, for example if the enum has three values then they can be packed as two bits. (because four values counting "unknown").

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