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

Combined #18

Merged
merged 4 commits into from
Feb 3, 2024
Merged

Combined #18

merged 4 commits into from
Feb 3, 2024

Conversation

alecthomas
Copy link
Owner

No description provided.

Jille and others added 4 commits February 3, 2024 23:36
It took me a bit to understand that s.start isn't actually used to
persist anything. Using a local variable for this seems simpler.
Just use ints pointing into the large byte slice.

Mmap() creates two `[]byte`s per key value pair. This creates
significant work for the garbage collector which has to scan through all
of these in each mark phase. For my 2.7M keys, it adds 5.4M pointers to
be scanned. By just using integers for offsets the garbage collector can
ignore it completely.

This does trade off some more work for the Builder which has to append
all the keys+values into a single byte slice.
@alecthomas alecthomas merged commit 914cee2 into master Feb 3, 2024
1 check passed
@alecthomas alecthomas deleted the combined branch February 3, 2024 12:40
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