Hello Tidy Bot, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/16075
to look at the new patch set (#2).
Change subject: [consensus] use move semantics for LogEntryBatchPB
......................................................................
[consensus] use move semantics for LogEntryBatchPB
As it turned out, in the context of the Log class and related utilities,
it's possible to get rid of the heap allocation and unique_ptr-wrapping
for LogEntryBatchPB. With this patch, instances of LogEntryBatchPB are
allocated on the stack and passed around using the move semantics.
There aren't "low-level unit" tests for the affected code paths and I'm
not sure it makes sense to introduce one. However, there is scenario
named 'MultiThreadedLogTest.TestAppends' in the "synthetic" mt-log-test.
To assess performance impact of this patch, I ran the following for
RELEASE builds with and without this patch:
./bin/mt-log-test --num_writer_threads=1 --num_batches_per_thread=500000
--num_reader_threads=0 --num_ops_per_batch_avg=1 --verify_log=false
--log_segment_size_mb=4096 --never_fsync --unlock_unsafe_flags
--gtest_filter='MultiThreadedLogTest.TestAppends' --gtest_repeat=100 | \
grep 'Time spent inserting 500000 batches' | awk '{print $14}' | \
sed 's/s$//' | awk 'BEGIN { sum = 0 } { sum += $1 } END { print sum }'
With each run producing summary like below:
Time spent inserting 500000 batches(1 threads, 500000 per-thread): real
7.506s user 0.000s sys 0.000s
I got the following results:
with the patch:
711.679
without the patch:
736.141
So, the performance at least didn't degrade.
Change-Id: Ib5d3c384dd6f17e8c4c71eec074af9e98827262b
---
M src/kudu/consensus/consensus_queue.cc
M src/kudu/consensus/consensus_queue.h
M src/kudu/consensus/log.cc
M src/kudu/consensus/log.h
M src/kudu/consensus/log_cache-test.cc
M src/kudu/consensus/log_cache.cc
M src/kudu/consensus/log_cache.h
M src/kudu/consensus/log_reader.cc
M src/kudu/consensus/log_reader.h
M src/kudu/consensus/log_util.cc
M src/kudu/consensus/log_util.h
11 files changed, 70 insertions(+), 71 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/75/16075/2
--
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: newpatchset
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)