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

Optimizations to struct deserialization #2393

Closed
raychu86 opened this issue Mar 13, 2024 · 1 comment
Closed

Optimizations to struct deserialization #2393

raychu86 opened this issue Mar 13, 2024 · 1 comment

Comments

@raychu86
Copy link
Contributor

We currently have an optimization in deserializing BatchCertificates by parallelizing the deserialization of signatures -
https://github.com/AleoHQ/snarkVM/blob/1969efc3747256c7b5837bce7d33bb7489308f87/ledger/narwhal/batch-certificate/src/bytes.rs#L39-L44

We can apply this technique to other places where we know the internal object being deserialized has a fixed size. Some examples are:

Previous certificates in BatchHeader - https://github.com/AleoHQ/snarkVM/blob/1969efc3747256c7b5837bce7d33bb7489308f87/ledger/narwhal/batch-header/src/bytes.rs#L64-L68

Members in a Committee - https://github.com/AleoHQ/snarkVM/blob/1969efc3747256c7b5837bce7d33bb7489308f87/ledger/committee/src/bytes.rs#L42-L50

This will help improve the message processing speed of nodes because all messages sent through the network must be deserialized from bytes.

Additional note: If possible, applying a more sophisticated version of this optimization to lists where the internal object does not have a fixed size, would have an even more significant impact on performance.

@raychu86
Copy link
Contributor Author

Closing with #2395

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