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

Add manual batching mechanism #758

Merged
merged 21 commits into from
Oct 24, 2024
Merged

Conversation

jean-roland
Copy link
Contributor

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

Closes #298. This adds an API to do manual batching which yields improved throughput performance for smaller packets.

User can start batching with zp_start_batching, any subsequent api call that would have put a network message (z_put, z_get, z_declare...) is bufferized to be later sent as a batch (or multiple batches) when user calls zp_stop_batching.

While I was modifying the transports I decided to refactor a little because the functions were too complicated to parse.

Copy link

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

@jean-roland jean-roland added the enhancement Things could work better label Oct 22, 2024
include/zenoh-pico/api/primitives.h Outdated Show resolved Hide resolved
src/transport/multicast/transport.c Outdated Show resolved Hide resolved
Copy link
Member

@sashacmc sashacmc left a comment

Choose a reason for hiding this comment

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

Last nit, others LGTM

src/transport/multicast/tx.c Outdated Show resolved Hide resolved
@gabrik gabrik merged commit ae30a60 into eclipse-zenoh:dev/1.1.0 Oct 24, 2024
53 of 54 checks passed
@jean-roland jean-roland deleted the ft_batching branch October 24, 2024 12:43
jean-roland added a commit to jean-roland/zenoh-pico that referenced this pull request Nov 13, 2024
* feat: add _vec_steal and _vec_null

* chore: remove stray ;

* feat: add network message copy function

* fix: memory leak

* feat: abstract transport mutex

* build: add batching config token

* feat: add transport batching state functions

* feat: add multicast batching

* refactor: unicast tx function

* feat: add unicast tx batching

* feat: add batching api

* fix: multicast peer mutex

* fix: single thread compilation

* feat: restore wbuf if batch if too full

* fix: redundant buf reset

* feat: pass sn by value

* feat: send fragment with batching if needed

* feat: rename batch api functions

* feat: switch transport mutex functions to static inline

* doc: add batching api doc

* fix: boolean condition
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