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

Cow snapshots instead of always cloning #161

Merged
merged 2 commits into from
Nov 5, 2019
Merged

Conversation

victorporof
Copy link
Contributor

@victorporof victorporof commented Nov 3, 2019

To satisfy LMDB's semantics, querying or modifying individual transactions has certain behavior guarantees. Each transaction is a snapshot of the database; in other words, multiple read/write transactions are views into the database at the beginning of the transaction, altering or querying independent of each other.

To do this in safe mode, we create database snapshots when instantiating transactions (cloning on read). This is needlessly precautious, we can opt for cloning on write instead. This PR improves performance in case of large databases and the usual use of transactions.

Copy link
Member

@ncloudioj ncloudioj left a comment

Choose a reason for hiding this comment

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

r+!

@victorporof victorporof merged commit 1a227d7 into safe-arena Nov 5, 2019
victorporof added a commit that referenced this pull request Nov 5, 2019
Cow snapshots instead of always cloning

Signed-off-by: Victor Porof <[email protected]>
@victorporof victorporof deleted the cow-snapshots branch November 5, 2019 11:01
victorporof added a commit that referenced this pull request Nov 5, 2019
Cow snapshots instead of always cloning
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