Skip to content

Refactor shmem::Message to reduce its size in memory#485

Merged
rbx merged 4 commits into
FairRootGroup:devfrom
rbx:refactor-shm-msg
Oct 19, 2023
Merged

Refactor shmem::Message to reduce its size in memory#485
rbx merged 4 commits into
FairRootGroup:devfrom
rbx:refactor-shm-msg

Conversation

@rbx

@rbx rbx commented Oct 18, 2023

Copy link
Copy Markdown
Member
  • Move the members of MetaHeader flat into shmem::Message and sort them by size.
  • Remove alignment member. Accept explicit argument for the method where it is needed (SetUsedSize), optionally. By default try to deduce reasonable alignment.

This reduces the size of shmem::Message from 92 bytes to 80 bytes. Two more members not clearly visible when skimming through the class are the this pointer, since we use virtual methods, and the member of the parent class - fTransport.

@rbx rbx marked this pull request as draft October 18, 2023 19:44
@rbx rbx marked this pull request as ready for review October 18, 2023 19:44
@rbx

rbx commented Oct 18, 2023

Copy link
Copy Markdown
Member Author

Want to do couple more tests before review, but let the CI run already.

@rbx rbx requested a review from dennisklein October 19, 2023 09:40

@dennisklein dennisklein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please put the explanation text from the PR why you flatten the MetaHeader member also into the first commit msg. Thx! Otherwise looks all fine to me.

rbx added 4 commits October 19, 2023 18:22
Move the members of MetaHeader flat into shmem::Message and sort them by
size to reduce the size of the class.
@rbx rbx force-pushed the refactor-shm-msg branch from f61ffdb to 8cbbf42 Compare October 19, 2023 16:27
@rbx rbx merged commit f05a09d into FairRootGroup:dev Oct 19, 2023
@rbx rbx deleted the refactor-shm-msg branch February 16, 2024 12:20
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.

2 participants