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

Consider to improve performance of the serialize function #71

Open
mikir opened this issue Feb 4, 2025 · 0 comments
Open

Consider to improve performance of the serialize function #71

mikir opened this issue Feb 4, 2025 · 0 comments
Milestone

Comments

@mikir
Copy link
Collaborator

mikir commented Feb 4, 2025

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.

@mikir mikir added this to the Backlog milestone Feb 4, 2025
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