Skip to content

Perf: add is_trivially_copyable trait#1267

Open
678098 wants to merge 1 commit intobloomberg:mainfrom
678098:260407_opt_DataStreamMessage
Open

Perf: add is_trivially_copyable trait#1267
678098 wants to merge 1 commit intobloomberg:mainfrom
678098:260407_opt_DataStreamMessage

Conversation

@678098
Copy link
Copy Markdown
Collaborator

@678098 678098 commented Apr 7, 2026

Some of the data structs are safe to copy with memcpy

@678098 678098 requested a review from a team as a code owner April 7, 2026 14:43
@678098 678098 requested a review from dorjesinpo April 7, 2026 14:44
@678098 678098 changed the title Perf[mqb]: preallocate data stream Perf[mqb]: preallocate d_apps Apr 7, 2026
@678098 678098 changed the title Perf[mqb]: preallocate d_apps Perf[mqb]: preallocate d_apps Apr 7, 2026
@678098 678098 force-pushed the 260407_opt_DataStreamMessage branch from 2b89c87 to 965e937 Compare April 7, 2026 19:28
Copy link
Copy Markdown
Collaborator

@hallfox hallfox left a comment

Choose a reason for hiding this comment

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

The is_trivially_copyable changes lgtm

Copy link
Copy Markdown
Collaborator

@dorjesinpo dorjesinpo left a comment

Choose a reason for hiding this comment

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

The initial idea was to allocate memory on demand - potentially useful with a large number of apps.
It looks like we have a trade-off between this and slow resize.
Maybe, we can elaborate and still not allocate immediately but not use resize when there is nothing to resize?
The only use case for non empty resize is proxy when receives separate PUSH messages for the same App, same GUID.

@dorjesinpo dorjesinpo assigned 678098 and unassigned dorjesinpo Apr 9, 2026
@678098 678098 force-pushed the 260407_opt_DataStreamMessage branch from 965e937 to b2582c2 Compare April 24, 2026 21:51
@678098 678098 changed the title Perf[mqb]: preallocate d_apps Perf: add is_trivially_copyable trait Apr 24, 2026
@678098 678098 requested a review from hallfox April 24, 2026 21:52
@678098 678098 assigned hallfox and unassigned 678098 Apr 24, 2026
@678098
Copy link
Copy Markdown
Collaborator Author

678098 commented Apr 24, 2026

Removed appMessage preallocation, kept only is_trivially_copyable change

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
@678098 678098 force-pushed the 260407_opt_DataStreamMessage branch from b2582c2 to 9998422 Compare April 24, 2026 21:53
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