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

WIP: Make an explicit EncodedIndex and IndexShiftData table #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kosak
Copy link
Contributor

@kosak kosak commented Nov 8, 2021

Do this so the Barrage format is somewhat more self-documenting and has fewer instances of unadorned "[byte]" types.

Also, making IndexShiftData explicit allows code to stream over "starts", "ends", and "deltas" without having to first read them all into memory. Put another way, there are three indices embedded in IndexShiftData. Prior to this change you would not know where the "ends" index starts until you scanned all of the "starts" index. Likewise you would not know where the "deltas" index starts until you had scanned all the "ends" index.

Having them be explicit gives code the opportunity to start processing the IndexShiftData without necessarily reading through all of it first, which could provide an advantage.

These changes would increase the size of the messages by a constant number of bytes, and it would add a layer of indirection, but I don't think these costs would be significant.

barrage format is a little more self-documenting and has fewer instances
of unadorned "[byte]" types.
@kosak
Copy link
Contributor Author

kosak commented Nov 8, 2021

This is not a complete change (because I didn't change any implementing code) but it represents my thoughts on how Barrage.fbs could be a little more strongly-typed than it is now.

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

Successfully merging this pull request may close these issues.

1 participant