Optimizations to struct deserialization
Closed this issue · 1 comments
We currently have an optimization in deserializing BatchCertificate
s 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.