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

Optimize struct byte padding for flow.Flow #21

Open
1 task
aaronfuj opened this issue May 17, 2023 · 0 comments · May be fixed by #23
Open
1 task

Optimize struct byte padding for flow.Flow #21

aaronfuj opened this issue May 17, 2023 · 0 comments · May be fixed by #23
Assignees

Comments

@aaronfuj
Copy link
Contributor

aaronfuj commented May 17, 2023

Per #20, @cleroux noticed that we could better optimize this heavily used struct often in the hot path and being instantiated a lot.

This struct can be optimized to reduce memory usage by about 6% if my napkin math is correct. I only mention it because this seems like a struct we instantiate a lot. There are a couple gaps in this struct if we consider the 8-byte alignment.
I think you can add AppProtocol without increasing memory usage if you insert it immediately after TcpRetransmit uint32

While the AppProtocol was moved closer, this issue is to evaluate the overall struct field ordering and improve upon it to be more efficient for 64-bit architectures.

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants