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

Inline FieldType array in RecordRefInner #2101

Merged
merged 2 commits into from
Sep 28, 2023
Merged

Inline FieldType array in RecordRefInner #2101

merged 2 commits into from
Sep 28, 2023

Conversation

Jesse-Bakker
Copy link
Contributor

This saves a pointer per recordref, which can be a significant memory
saving in the presence of many small records. This also makes the Arc
containing RecordRefInner a thin pointer, saving some more memory if
there are many references to a record.

This saves a pointer per recordref, which can be a significant memory
saving in the presence of many small records. This also makes the Arc
containing RecordRefInner a thin pointer, saving some more memory if
there are many references to a record.
@Jesse-Bakker Jesse-Bakker requested a review from chubei September 28, 2023 08:28
Copy link
Contributor

@chubei chubei left a comment

Choose a reason for hiding this comment

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

Cool. I didn't realize Arc<SliceWithHeader> is 16 bytes. Really fat!

dozer-recordstore/src/in_memory/mod.rs Outdated Show resolved Hide resolved
@Jesse-Bakker
Copy link
Contributor Author

Cool. I didn't realize Arc<SliceWithHeader> is 16 bytes. Really fat!

Yeah, any pointer to a DST will become fat by including the object's size. That goes for references, raw pointers, but also smart pointers like Arc/Rc and Box.
In this case, that size just moves into the allocation, because it has to, but that has the side benefit of shrinking the pointer size.

@Jesse-Bakker Jesse-Bakker added this pull request to the merge queue Sep 28, 2023
Merged via the queue into getdozer:main with commit cde7073 Sep 28, 2023
@Jesse-Bakker Jesse-Bakker deleted the feat/inline-fieldtypes branch September 28, 2023 15:26
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