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

Improve throughput performance #4 (rx defragmentation focus) #754

Merged
merged 11 commits into from
Oct 22, 2024

Conversation

jean-roland
Copy link
Contributor

@jean-roland jean-roland commented Oct 21, 2024

In order to improve rx performance we need to reduce the amount of copies that are made. Defragmentation had 3 copies, it was reduced to 1. It could have been reduced to 0 but it would have made the PR much heavier and it would have slowed down non-fragmented data, which is still the main usecase.

There's still an uplift of 25% less time spent recopying data on a 150kB payload in our throughput test.

  • Now fragment payload are aliased, then recopied in the defragmentation tx_buffer with is then cheaply converted to a rx_buffer before being decoded (vs copy, copy and copy). User can take ownership of this buffer.

  • Added a state to allocate the buffer only when needed and to mark when it has overflown.

  • Fixed some UBs and memory leaks.

@jean-roland jean-roland added the enhancement Things could work better label Oct 21, 2024
@jean-roland jean-roland changed the title Improve throughput performance #4 (defragmentation focus) Improve throughput performance #4 (rx defragmentation focus) Oct 21, 2024
@gabrik gabrik merged commit b6a4599 into eclipse-zenoh:dev/1.1.0 Oct 22, 2024
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants