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

Don't use the LMDB useWritemap option if we know we don't need it #1123

Merged
merged 1 commit into from
May 20, 2020

Conversation

FUDCo
Copy link
Contributor

@FUDCo FUDCo commented May 19, 2020

The LMDB useWritemap option, which was required for LMDB to work properly when running on WSL, unconditionally creates a ~2GB database file (even though it doesn't actually take up that much space on disk until you actually put that much data in). This makes it hard to measure database space usage by looking at the file size, since now the file size is constant. However, if we know we are running on an OS where we know LMDB works without the useWritemap option, we can do without it and return to a world where we can get useful measurements of database space usage. MacOS is one such, so at a minimum we can exempt that, which is what this change does. It's possible that we could cook up some more sophisticated way to test for WSL specifically, but this much simpler test is doable immediately.

@FUDCo FUDCo added the performance Performance related issues label May 19, 2020
@FUDCo FUDCo requested a review from warner May 19, 2020 21:13
Copy link
Member

@warner warner left a comment

Choose a reason for hiding this comment

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

looks good, but let's add a comment to remind ourselves that macOS and linux are (probably) equally capable, it's just that os.platform doesn't give us a way to distinguish between linux and WSL

@FUDCo FUDCo force-pushed the skip-unnecessary-writemap branch from c3b588e to c272e43 Compare May 20, 2020 00:17
@FUDCo FUDCo merged commit 81eb6ba into master May 20, 2020
@FUDCo FUDCo deleted the skip-unnecessary-writemap branch May 20, 2020 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants