-
Notifications
You must be signed in to change notification settings - Fork 79
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
Optimize some db accesses #743
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make less movements.
Getting references requires DB access and that is expensive.
It's a key for it, makes no sense storing it as data.
As they're all about the state.
As it was intended to.
roman-khimov
force-pushed
the
optimize-some-db-accesses
branch
from
March 11, 2020 09:24
39ee688
to
6f49960
Compare
Codecov Report
@@ Coverage Diff @@
## master #743 +/- ##
==========================================
- Coverage 66.77% 66.59% -0.18%
==========================================
Files 136 135 -1
Lines 12213 12149 -64
==========================================
- Hits 8155 8091 -64
- Misses 3664 3667 +3
+ Partials 394 391 -3
Continue to review full report at Codecov.
|
roman-khimov
force-pushed
the
optimize-some-db-accesses
branch
from
March 11, 2020 09:28
6f49960
to
154a71f
Compare
… things This change reduces pressure on DB by doing the following things: * not storing additional KV pair for SpentCoin * storing Output right in the UnspentCoin, thus eliminating the need to get a full transaction from DB At the same time it makes UnspentCoin more fat and hot, but it should probably worth it. Also drop `GetUnspentCoinStateOrNew` as it shouldn't ever existed, UTXOs can't come out of nowhere. 1.5M block import time (VerifyBlocks disabled) on AMD Ryzen 5 1600/16GB/HDD, before: real 302m9.895s user 96m17.200s sys 13m37.084s after: real 159m16.551s user 69m58.279s sys 7m34.334s So it's almost two-fold which is a great improvement.
1.5M block import time (VerifyBlocks disabled) on AMD Ryzen 5 1600/16GB/HDD, before: real 159m16.551s user 69m58.279s sys 7m34.334s after: real 139m41.836s user 67m12.477s sys 6m19.420s 12% which is even a bit more than could be expected from inputs analysis (that has around 10% cache hits for a block-wide cache), worth doing.
roman-khimov
force-pushed
the
optimize-some-db-accesses
branch
from
March 11, 2020 09:40
154a71f
to
8c902a7
Compare
fyrchik
approved these changes
Mar 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Slow block import.
Solution
Fix some suboptimal DB usage.