Skip to content

Consider to improve performance of the serialize function #71

@mikir

Description

@mikir

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::validate function to check data correctness
  • zserio::detail::initializeOffsets or zserio::detail::bitSizeOf function 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions