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

Reduce length-prepending in BFieldCodec encoding through the use of Cursor #122

Open
Sword-Smith opened this issue Jun 13, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Sword-Smith
Copy link
Member

By using a Cursor data struct, I think we can avoid the prepending of the struct length when encoding both Vec<T> and [T; N]. Each element is double length prepended since the length prepending happens in both the encoding implementation for Vec<T> and T when the encoding length is not known at compile time.

I think this can be avoided if we use a type of Cursor<Vec<BFieldElement>> for the decoding process.

@Sword-Smith Sword-Smith added enhancement New feature or request good first issue Good for newcomers labels Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant