Todd Lipcon has submitted this change and it was merged. Change subject: Avoid unnecessary vector<Slice> allocations for ReadV/WriteV-like APIs ......................................................................
Avoid unnecessary vector<Slice> allocations for ReadV/WriteV-like APIs This reduces extra short-lived allocations for the various scatter-gather (aka "vectored") read/write APIs. These APIs used to all take vector<Slice>, which forces the caller to allocate on the heap. Almost all of the call sites only need a small constant number of slices, so the heap allocation is unnecessary overhead. This patch imports ArrayView<T> from Chromium/WebRTC. This is a view into an existing array or vector (similar to how a StringPiece is a view into a string or character array). The vectored read/write APIs are converted to use ArrayView<Slice> instead of vector<Slice>. Change-Id: I4eab29dad2e16cc5fce724d3bdd173f3a60cb266 Reviewed-on: http://gerrit.cloudera.org:8080/8077 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins --- M LICENSE.txt M build-support/iwyu/iwyu-filter.awk M src/kudu/cfile/cfile-test.cc M src/kudu/cfile/cfile_reader.cc M src/kudu/cfile/cfile_reader.h M src/kudu/consensus/log_util.cc M src/kudu/fs/block_manager-stress-test.cc M src/kudu/fs/block_manager-test.cc M src/kudu/fs/block_manager.h M src/kudu/fs/file_block_manager.cc M src/kudu/fs/fs-test-util.h M src/kudu/fs/fs_manager-test.cc M src/kudu/fs/log_block_manager-test.cc M src/kudu/fs/log_block_manager.cc M src/kudu/tools/tool_action_fs.cc M src/kudu/tserver/tablet_copy-test-base.h M src/kudu/tserver/tablet_copy_client-test.cc M src/kudu/tserver/tablet_copy_service-test.cc M src/kudu/tserver/tablet_copy_source_session-test.cc M src/kudu/tserver/tablet_copy_source_session.cc M src/kudu/tserver/tablet_copy_source_session.h A src/kudu/util/array_view.h M src/kudu/util/env-test.cc M src/kudu/util/env.h M src/kudu/util/env_posix.cc M src/kudu/util/file_cache-stress-test.cc M src/kudu/util/file_cache-test.cc M src/kudu/util/file_cache.cc M src/kudu/util/pb_util-test.cc M src/kudu/util/pb_util.cc 30 files changed, 348 insertions(+), 148 deletions(-) Approvals: Adar Dembo: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/8077 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4eab29dad2e16cc5fce724d3bdd173f3a60cb266 Gerrit-PatchSet: 5 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Todd Lipcon <[email protected]>
