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

Major performance improvement to compact() #858

Merged
merged 4 commits into from
Sep 2, 2024
Merged

Major performance improvement to compact() #858

merged 4 commits into from
Sep 2, 2024

Conversation

cberner
Copy link
Owner

@cberner cberner commented Sep 2, 2024

Fixes #852

compact() previously moved pages down to lower indices in a semi-random
and optimistic way. However, this took O(N^2) time in the size of the
database.

This changes the compaction algorithm to identify the pages at the end
of the database file which can be moved, and only move those pages. This
is done iteratively until no more pages can be moved
heed is a wrapper around lmdb
@cberner cberner merged commit ca58129 into master Sep 2, 2024
3 checks passed
@cberner cberner deleted the compaction2 branch September 2, 2024 21:03
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.

Busy loop during compaction
1 participant