Mike Percy has submitted this change and it was merged. Change subject: raft_consensus: avoid some unecessary allocations in hot path ......................................................................
raft_consensus: avoid some unecessary allocations in hot path In the stress cluster I noticed that UpdateConsensus does a lot of allocation in LockForUpdate. In particular, it was constructing a ConsensusStatusPB just to check whether it was currently a voter, and that only to provide a log message. That PB has a lot of various strings and other objects inside of it which caused unnecessary allocation. We can already get this same information from the existing RaftConfigPB object in ConsensusMeta, and a lot cheaper. Change-Id: I75abcaaaed281e5ac1768ea3014064925db6c030 Reviewed-on: http://gerrit.cloudera.org:8080/5344 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <mpe...@apache.org> --- M src/kudu/consensus/raft_consensus_state.cc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mike Percy: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/5344 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75abcaaaed281e5ac1768ea3014064925db6c030 Gerrit-PatchSet: 2 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org>