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

Faster block existence check when the block type is known #1484

Merged
merged 1 commit into from Dec 19, 2018

Conversation

Projects
3 participants
@cryptocode
Copy link
Collaborator

commented Dec 18, 2018

After #1483, block_exists (stateblock) is the next function that shows up in the profiling of process_receive_one. Currently when checking state blocks, four other tables are checked first. With this, the correct table is checked directly if the block type is known. The current block_exists (where the block type is unknown) is reimplemented in terms of the new one.

Part of #1478

@rkeene rkeene added this to the V18.0 milestone Dec 18, 2018

@@ -217,7 +217,7 @@ void ledger_processor::state_block (rai::state_block const & block_a)
void ledger_processor::state_block_impl (rai::state_block const & block_a)
{
auto hash (block_a.hash ());
auto existing (ledger.store.block_exists (transaction, hash));
auto existing (ledger.store.block_exists (transaction, block_a.type (), hash));

This comment has been minimized.

Copy link
@SergiySW

SergiySW Dec 18, 2018

Collaborator

Wondering if we can directly put types here & for other similar ledger_processor items like rai::block_type::state

This comment has been minimized.

Copy link
@cryptocode

cryptocode Dec 18, 2018

Author Collaborator

Yeah, I couldn't decide on that :)

This comment has been minimized.

Copy link
@rkeene

rkeene Dec 19, 2018

Contributor

I think it'll be okay -- we can always change it if it shows up in profiling

@rkeene

rkeene approved these changes Dec 18, 2018

Copy link
Contributor

left a comment

Looks good to me !

@rkeene rkeene merged commit dc11556 into nanocurrency:master Dec 19, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rkeene rkeene removed the experiment label Dec 19, 2018

@rkeene

This comment has been minimized.

Copy link
Contributor

commented Dec 19, 2018

Another experiment gone right. Good job !

@zhyatt zhyatt added this to Unscheduled in V18 Dec 27, 2018

@cryptocode cryptocode moved this from Unscheduled to CP 1 (2018-01-09) in V18 Dec 28, 2018

@cryptocode cryptocode moved this from CP 1 (2018-01-09) to CP 0 in V18 Dec 28, 2018

@cryptocode cryptocode deleted the cryptocode:block_exists-faster-lookup branch Jan 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.