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 Witness
Serialization
#1071
Optimize Witness
Serialization
#1071
Conversation
|
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.
GitHub does not let me comment on the commit log in line so commenting here.
The commit log is not correctly formatted. The subject should be separated from the body by a newline. (How are you making commits? Your tool should be able to be configured to warn you of this.)
I'm pretty anal about commit logs, I think they are important, they last for ever so are worth doing well. Here is the canonical blog post on the topic that I always link to: https://cbea.ms/git-commit/
I would prefer to see something like (notice subject then body (WHY then WHAT):
Optimize Witness serialization
Currently we allocate a new vector when serializing a Witness
, this is inefficient and unnecessary. We can use serialize_seq
to feed the witness elements directly into the serializer.
Optimize Witness
serialization by removing the allocation.
We allocated a new vector when serializing a `Witness`. That was inefficient and unnecessary. Use `serialize_seq` to feed the witness elements directly into the serializer. Optimize `Witness` serialization by removing the allocation.
0912593
to
9bf9591
Compare
I see the one import was already gated and wrongly assumed that would apply to every line that came after. this might work at the top as well: #[cfg(features = "serde")]
use serde::{self, ser::SerializeSeq}; but I matched the imports with @tcharding's Human readable pr so as not to conflict. This was supposed to be trivial merge so I don't have to ask for ci runtime, but I learned about feature gates and why git rebase reword highlighted red on me. fixed. |
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.
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.
ACK 9bf9591
The commit message is fixed BTW to use Tobin's suggestion. |
Thanks @DanGould. |
9bf9591 Optimize Witness Serialization (DanGould) Pull request description: fix #942 > self.to_vec() allocates, it should be possible to avoid it - just feed the items into serializer. based on rust-bitcoin/rust-bitcoin#1068 ACKs for top commit: Kixunil: ACK 9bf9591 apoelstra: ACK 9bf9591 Tree-SHA512: 14553dfed20aee50bb6361d44986b38556cbb3e112e1b4d9e3b401c3da831b6bdf159089966254cf371c225ae929fc78516c96a6114b40a7bc1fda7305295e4a
fix #942
based on #1068