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 #3 (rx buffer focus) #749

Open
wants to merge 12 commits into
base: dev/1.1.0
Choose a base branch
from

Conversation

jean-roland
Copy link
Contributor

In order to improve rx performance we need to reduce the amount of copies that are made. By using a refcount and by allocating dynamically the rx buffers we can avoid copies at the cost of memory allocation, only in the case where data is processed out of context [note: that is the case of query replies in latest consolidation mode].

  • The rx buffers (zbuf_t) now have a refcounted slice. If after processing there are more than 1 refcount, the transport will allocate a new buffer.
  • Fixed a few undefined behaviors in tests and examples.

@jean-roland jean-roland changed the title mprove throughput performance #3 (rx buffer focus) Improve throughput performance #3 (rx buffer focus) Oct 17, 2024
Copy link

PR missing one of the required labels: {'internal', 'new feature', 'bug', 'enhancement', 'dependencies', 'breaking-change', 'documentation'}

@jean-roland jean-roland added the enhancement Things could work better label Oct 17, 2024
// Check if user or defragment buffer took ownership of buffer
if (!_z_zbuf_is_last_ref(&ztm->_zbuf)) {
// Allocate a new buffer
_z_zbuf_t new_zbuf = _z_zbuf_make(Z_BATCH_MULTICAST_SIZE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the raweth very well, but should we use Z_BATCH_MULTICAST_SIZE there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because raweth is a mix between a link and a multicast transport so it should behave as closely as possible as such.

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