Andrew Wong has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/16075 )

Change subject: [consensus] use move semantics for LogEntryBatchPB
......................................................................


Patch Set 2: Code-Review+2

> Patch Set 2:
>
> > Would be nice to quantify the perf improvement for this. While heap
>  > allocation might be expensive, iiuc moving PBs entails trivial
>  > copies on move, which might add up, vs pointer swizzling.
>
> Keep in mind that moving around std::unique_ptr also involves trivial copying 
> and calling a couple of std::unique_ptr methods, and now this and also 
> creation of std::unique_ptr instances are both gone.

Thanks for the findings! It seems that the move constructor for PBs works via 
swapping metadata pointers, which I imagine is quite cheap -- at least 
comparable to swapping a pointer as we would for std::unique_ptr, as you found.


--
To view, visit http://gerrit.cloudera.org:8080/16075
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib5d3c384dd6f17e8c4c71eec074af9e98827262b
Gerrit-Change-Number: 16075
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Mon, 15 Jun 2020 15:51:22 +0000
Gerrit-HasComments: No

Reply via email to