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

Introduce Mmapped buffers and Merge Sort #194

Merged
merged 7 commits into from
Sep 22, 2020
Merged

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Sep 22, 2020

Buffers can now be mmapped as well as Calloc'd. This PR also copies over all the mmap files from Badger to allow mmap support in various platforms.

This PR also introduces Merge Sort to do sorting of the buffer using an extra temporary space costing half of the space as the original buffer, currently allocated on Calloc. We can't use quick sort. Each entry is variable length, so we can't just swap them in the buffer. Merge Sort allows us to iterate over them linearly, hence is a better fit.


This change is Reviewable

Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 9 files reviewed, all discussions resolved (waiting on @anurags92, @karlmcguire, and @martinmr)

@manishrjain manishrjain merged commit 148048a into master Sep 22, 2020
@manishrjain manishrjain deleted the mrjn/buffer-mmap branch September 22, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants