-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
} | ||
|
||
unsafe impl Send for Database {} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Write(Vec<u8>), | ||
} | ||
|
||
pub struct WriteQueue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be called WriteCache
while removed_so_far < amount { | ||
if self.cache.len() == 0 { break; } | ||
let removed_key = { | ||
let (key, cache_entry) = self.cache.iter().nth(0).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.expect
prove or remove.
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