Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Write queue to speed-up db ipc #1160

Merged
merged 13 commits into from
May 28, 2016
Merged

Write queue to speed-up db ipc #1160

merged 13 commits into from
May 28, 2016

Conversation

NikVolf
Copy link
Contributor

@NikVolf NikVolf commented May 27, 2016

Benches actually fail to reflect the speedup because it's about multithreaded writes&flushes, but on my pc sync speed is back to the level of master

@NikVolf NikVolf added the A0-pleasereview 🤓 Pull request needs code review. label May 27, 2016
}

unsafe impl Send for Database {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's about upstream wrapper, cause it does not explicitly says it is Sync+Send

Copy link
Contributor

Choose a reason for hiding this comment

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

you could wrap the iterators in an UnsafeCell rather than RwLock so all accesses have to be made explicitly unsafe and are more likely to be checked

@NikVolf NikVolf changed the title Write que to speed-up db ipc Write queue to speed-up db ipc May 27, 2016
@NikVolf NikVolf added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. and removed A0-pleasereview 🤓 Pull request needs code review. labels May 27, 2016
@NikVolf NikVolf added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels May 27, 2016
Write(Vec<u8>),
}

pub struct WriteQueue {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be called WriteCache

@gavofyork gavofyork merged commit 6319e29 into db-ipc-cont May 28, 2016
@gavofyork gavofyork deleted the db-ipc-opt branch May 28, 2016 09:48
while removed_so_far < amount {
if self.cache.len() == 0 { break; }
let removed_key = {
let (key, cache_entry) = self.cache.iter().nth(0).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

.expect

prove or remove.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-pleasereview 🤓 Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants