Repository navigation
CHashWriter that does SHA256 in-place during serialization - #1567
Merged
Merged
Conversation
Member
|
Nice! ACK on the code. May need testcases, though there are currently no testcases for CDataStream with SER_GETHASH at all. |
Contributor
|
ACK, though Im interested to see what kind of improvement you see by simply removing duplicated Hash calls. |
Contributor
|
ACK |
1 similar comment
Contributor
|
ACK |
lateminer
pushed a commit
to lateminer/bitcoin
that referenced
this pull request
May 6, 2020
c67fcec [Trivial] Hide CWallet::MultiSend() call in main (random-zebra) f50918e [RPC] Disable/Hide multisend (random-zebra) 7ac2aee [GUI] Hide MultiSend in the options (random-zebra) Pull request description: Multisend flow is clunky and sorely out of date / in need of a full overhaul and review. Let's disable it for now until such time that it can be either re-coded properly, or just dropped entirely. We can thus close the following issues for now: bitcoin#1560, bitcoin#1561, bitcoin#1563, bitcoin#1567 . ACKs for top commit: Fuzzbawls: ACK c67fcec furszy: ACK c67fcec Tree-SHA512: 2719c346c44fc3baaded05c3fe320e59c85e5549e96358873ffb1ce87cd2a89ffb471ac014b737975a3a6a31ced72c4639622b8c8527eabc36564492d367547e
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
SerializeHash used to create a memory-backed CDataStream, serialize the object (almost always a CTransaction) to it, and then feed it to SHA256. As most of the time is actually spent in allocating/deallocating the buffer, it is better to do the SHA256 in-place. That is what CHashWriter does.
On my system, in ultraprune running on a tmpfs-backed datadir, this alone reduces total CPU time spent during import of 185k blocks by 4-5%.