Skip to content

Introduce Mmapped buffers and Merge Sort#194

Merged
manishrjain merged 7 commits intomasterfrom
mrjn/buffer-mmap
Sep 22, 2020
Merged

Introduce Mmapped buffers and Merge Sort#194
manishrjain merged 7 commits intomasterfrom
mrjn/buffer-mmap

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