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

CheckBlock was being computed more than once #26

Open
wants to merge 2 commits into
base: 2.0
Choose a base branch
from

Conversation

pol081
Copy link

@pol081 pol081 commented Jun 9, 2017

This sits on top of Pull request #25

CheckBlock takes about 2x the time of GetHash and was being calculated at least twice per block during bootstrap. Changed CheckBlock to only compute on the first call.

Tested by looking at LoadExternalBlockFile and every 500 blocks printed (total elapsed time/ nloaded) in ms

nLoaded Avg Before Avg After Avg
500 4.98ms 2.54ms 1.80ms
20000 5.96ms 3.38ms 2.79ms
100000 7.97ms 5.26ms 4.75ms

pol081 added 2 commits June 6, 2017 20:34
…p ProcessBlock -> AcceptBlock calls each did a GetHash. Changed GetHash to only compute on the first call to GetHash and store in memory only the hash (If ever loaded it would have to hash again) Using mutable on those objects to acomplish this so not sure if I am breaking code practices
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.

1 participant