summaryrefslogtreecommitdiffstats
path: root/adb/socket_test.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2018-03-07 16:52:28 -0800
committerJosh Gao <jmgao@google.com>2018-04-11 12:54:07 -0700
commit1ce99576f0cf76a9cfe4176c0a4a2cb018568a52 (patch)
treefc09fde6787026ac89c046b86803065a702ad08b /adb/socket_test.cpp
parent1b86d41c7844729768b2ffd096e1cded3c145a93 (diff)
downloadsystem_core-1ce99576f0cf76a9cfe4176c0a4a2cb018568a52.tar.gz
system_core-1ce99576f0cf76a9cfe4176c0a4a2cb018568a52.tar.bz2
system_core-1ce99576f0cf76a9cfe4176c0a4a2cb018568a52.zip
adb: switch apacket payload to a type that doesn't initialize its contents.
Switch from using std::string as the type we use to hold our payload in apacket to a custom reimplementation that doesn't zero initialize. This improves bulk transfer throughput in the adb_benchmark microbenchmark on walleye by ~20%. Test: adb shell taskset f0 /data/benchmarktest64/adb_benchmark/adb_benchmark Change-Id: Ibad797701eb1460c9321b0400c5b167b89b2b4d0
Diffstat (limited to 'adb/socket_test.cpp')
-rw-r--r--adb/socket_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/socket_test.cpp b/adb/socket_test.cpp
index 6c4a8b2c1..04214a20b 100644
--- a/adb/socket_test.cpp
+++ b/adb/socket_test.cpp
@@ -118,7 +118,7 @@ static void CreateCloser(CloseWithPacketArg* arg) {
// each write to give the underlying implementation time to flush.
bool socket_filled = false;
for (int i = 0; i < 128; ++i) {
- std::string data;
+ apacket::payload_type data;
data.resize(MAX_PAYLOAD);
arg->bytes_written += data.size();
int ret = s->enqueue(s, std::move(data));