-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Batch construct batches #9346
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
Batch construct batches #9346
Conversation
Reuse the serialization buffers used for constructing the LevelDB write batch. This avoids 2 allocations per utxo write.
|
ACK. (I tested this on the above mentioned other branch.) |
|
Seems straightforward - code review ACK ed58969 |
| ssValue.reserve(DBWRAPPER_PREALLOC_VALUE_SIZE); | ||
| ssValue << value; | ||
| ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent)); | ||
| leveldb::Slice slValue(&ssValue[0], ssValue.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CDataStream should really get a .data(). Not necessarily here though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but let's do that separately (#9353?).
|
ACK ed58969 |
ed58969 Batch construct batches (Pieter Wuille)
ed58969 Batch construct batches (Pieter Wuille)
Reuse the serialization buffers used for constructing the LevelDB write batch. This avoids 2 allocations per utxo write.
I have not benchmarked this exact change, but in another branch I'm working on it results in a 12% speedup for the flush.