-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Users are supposed to use zserio::serialize function only because write function is implemented in the zserio::detail namespace.
However, the zserio::serialize function executes before serialization
zserio::detail::validatefunction to check data correctnesszserio::detail::initializeOffsetsorzserio::detail::bitSizeOffunction to get the size of the buffer needed for serialization
Both of these functions perform a complete traversal of the Zserio objects tree. But tree traversal is important from a performance perspective. Each tree traversal almost doubles the execution time. This leads to the 3x worse performance compared to a single call of the zserio::detail::write method.
Consider to improve this. For example, it might be that some new write function which would combine validation and writing will be useful. Or it might be that just to allow users to call zserio::detail::validate or zserio::detail::bitSizeOf will be enough.