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

Replace zed.Value.bytes slice with base and len #4812

Merged
merged 1 commit into from
Oct 24, 2023
Merged

Conversation

nwt
Copy link
Member

@nwt nwt commented Oct 23, 2023

A zed.Value occupies five words: two for the Type field (an interface) and three for the bytes field (a slice). Since the slice capacity field is rarely used (only in Value.CopyFrom), shrink Values to four words by replacing the bytes field with base (a pointer) and len (a uint64) fields. This can reduce maximum RSS by 1.4x when sorting a large input or loading a large input into a lake.

A zed.Value occupies five words: two for the Type field (an interface)
and three for the bytes field (a slice).  Since the slice capactiy field
is rarely used (only in Value.CopyFrom), shrink Values to four words by
replacing the bytes field with base (a pointer) and len (a uint64)
fields.  This can reduce maximum RSS by 1.4x when sorting a large input
or loading a large input into a lake.
@nwt nwt requested a review from a team October 23, 2023 15:02
@nwt nwt merged commit 88f40ed into main Oct 24, 2023
3 checks passed
@nwt nwt deleted the zed.Value-base-and-len branch October 24, 2023 00:13
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