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

Block import optimization #2748

Merged
merged 2 commits into from
Oct 20, 2016
Merged

Block import optimization #2748

merged 2 commits into from
Oct 20, 2016

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Oct 20, 2016

No description provided.

@arkpar arkpar added the A0-pleasereview 🤓 Pull request needs code review. label Oct 20, 2016
@@ -361,16 +361,19 @@ impl Client {

/// This is triggered by a message coming from a block queue when the block is ready for insertion
pub fn import_verified_blocks(&self) -> usize {
let max_blocks_to_import = 64;
let (imported_blocks, import_results, invalid_blocks, imported, duration) = {
let max_blocks_to_import = 4;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This prevents flushing buffer from growing too large.

// Dirty values added with `write_buffered`. Cleaned on `flush`.
overlay: RwLock<Vec<HashMap<ElasticArray32<u8>, KeyState>>>,
// Values currently being flushed. Cleared when `flush` completes.
flushing: RwLock<Vec<HashMap<ElasticArray32<u8>, KeyState>>>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

An optimization introduced here to allow DB queries while flush is in progress

@arkpar arkpar added B0-patch M4-core ⛓ Core client code / Rust. labels Oct 20, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 86.207% when pulling f304d1d on db-fix into d2e4baf on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 86.251% when pulling f304d1d on db-fix into d2e4baf on master.

[ci:none]
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 20, 2016
@gavofyork gavofyork merged commit 906dcd7 into master Oct 20, 2016
@gavofyork gavofyork deleted the db-fix branch October 20, 2016 12:49
arkpar added a commit that referenced this pull request Oct 20, 2016
* Block import optimization

* whitespace

[ci:none]
arkpar added a commit that referenced this pull request Oct 20, 2016
* v1.3.9

* Block import optimization (#2748)

* Block import optimization

* whitespace

[ci:none]

* Don't add empty accounts to bloom (#2753)

* Incrementally calculate verification queue heap size (#2749)

* incrementally calculate queue heap size

* query the correct queue sizes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants