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 alignment and padding of structs #75

Open
mlegner opened this issue Dec 4, 2023 · 0 comments
Open

Optimize alignment and padding of structs #75

mlegner opened this issue Dec 4, 2023 · 0 comments

Comments

@mlegner
Copy link
Contributor

mlegner commented Dec 4, 2023

There are specific representation and alignment rules for structs that affect the memory efficiency of our code. This is particularly pronounced if we use the C representation at some point (e.g., to enable C bindings and wrappers). Specifically, the ordering of fields becomes relevant for the C representation.

In general, having a hierarchy of structs (structs in structs) may be beneficial from a conceptual point of view but substantially less memory-efficient than a flattened struct.

@mlegner mlegner added this to the Backlog milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant