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

Recycle serialization buffers on transmission #342

Draft
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

fuzzypixelz
Copy link
Contributor

Adds a LIFO buffer pool in the context to reuse buffers allocated on serialization. The aim is not (only) to avoid the overhead of dynamic allocation but rather to enhance the cache locality of serialization buffers.

@fuzzypixelz
Copy link
Contributor Author

fuzzypixelz commented Dec 16, 2024

The aim of this pull request is to fix high latency for relatively large topics (e.g. 1 MB tagus) in the single-process iRobot benchmark with --ipc off. Results were obtained using the Mont Blanc topology on an Ubuntu 24.04.1 LTS machine with an Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz.

dd82e84

node topic size_b mean_us min_us max_us
ponce tagus 1000000 3016 2512 5705
geneva tagus 1000000 3513 2997 6457
mandalay tagus 1000000 2678 2214 5233

401016c

node topic size_b mean_us min_us max_us
ponce tagus 1000000 1947 1476 2788
geneva tagus 1000000 2200 1667 3063
mandalay tagus 1000000 1603 1225 1997

401016c + eed223a

node topic size_b mean_us min_us max_us
ponce tagus 1000000 393 257 1301
geneva tagus 1000000 657 438 1701
mandalay tagus 1000000 108 68 650

@fuzzypixelz fuzzypixelz changed the title Recycle serialization buffers on transmission. Recycle serialization buffers on transmission Dec 16, 2024
@clalancette
Copy link
Collaborator

All right, now that we've merged in #327 , we can consider this one. Please rebase this onto the latest, then we can do a full review of it. Until then, I'll mark it as a draft.

@clalancette clalancette marked this pull request as draft December 17, 2024 21:41
@YuanYuYuan YuanYuYuan mentioned this pull request Dec 18, 2024
@fuzzypixelz fuzzypixelz force-pushed the buffer-pool branch 2 times, most recently from 068cf50 to 21006d0 Compare December 19, 2024 11:32
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

There are also many changes unrelated with the goal of this PR

rmw_zenoh_cpp/src/detail/buffer_pool.hpp Outdated Show resolved Hide resolved
@fuzzypixelz fuzzypixelz force-pushed the buffer-pool branch 2 times, most recently from 7ca544b to bb6fd88 Compare December 19, 2024 14:46
@fuzzypixelz
Copy link
Contributor Author

There are also many changes unrelated with the goal of this PR

There was a formatting error from my IDE. I've restored the files and manually re-applied the patches.

@fuzzypixelz fuzzypixelz force-pushed the buffer-pool branch 4 times, most recently from 515c43a to 8dd9bf5 Compare December 20, 2024 15:56
Adds a bounded LIFO buffer pool in the context to reuse buffers
allocated on serialization. The aim is not (only) to avoid the
overhead of dynamic allocation but rather to enhance the cache
locality of serialization buffers.
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

Successfully merging this pull request may close these issues.

3 participants