[DO NOT MERGE] build: post-process .pb.go to not copy []byte in Unmarshal#6208
[DO NOT MERGE] build: post-process .pb.go to not copy []byte in Unmarshal#6208petermattis wants to merge 2 commits intocockroachdb:masterfrom
Conversation
|
Not sure how I feel about this change. I wanted to see how irritating it would be to make (it wasn't), but it is changing the semantics of |
41619a3 to
3c85585
Compare
|
I'm wary of changing the semantics too. It should be safe in most of our usage but I'd prefer to be able to opt-in only for those protos where we expect it to make a difference. Note that for the message that started this discussion, |
|
Ah, unmarshaling |
|
Here are some numbers showing the allocation savings: Note that because these benchmarks are running on a single node with the local-call optimization enabled, the benefits are underestimated. The time improvements are more modest, in the single digit range, mostly accruing to the Native versions presumably because this change will help GRPC performance. |
3c85585 to
9603c00
Compare
|
Added another commit which replaces the unmarshaling of |
|
Replacing raftpb.Entry may not be a big win for these SQL benchmarks, but @tamird found unmarshaling entries to be a large part of the cost of generating a snapshot. Another idea for doing this without post-processing would be to make a custom type that wraps a |
|
Yeah, I also had the thought about using a |
|
Changes of On Fri, Apr 22, 2016 at 8:36 PM, Peter Mattis notifications@github.com
|
|
Switch back to When using If I make the fields non-nullable then the encoding changes such that we always output the field even if the field |
Fix the one case where this wasn't safe: rocksDBIterator.Unmarshal() now unmarshals rocksDBIterator.Value() instead of unsafeValue().
9603c00 to
e40c7ac
Compare
|
Closing the PR as this isn't going to be merged any time soon. I'll keep the branch. |
Fix the one case where this wasn't safe: rocksDBIterator.Unmarshal() now
unmarshals rocksDBIterator.Value() instead of unsafeValue().
This change is