binderRpcBenchmark: test more data sizes
Data on Pixel 3.
Tests suffixes:
.../0 is KERNEL
.../1 is RPC
...
------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------
BM_pingTransaction/0 34506 ns 15936 ns 44173
BM_pingTransaction/1 44578 ns 23682 ns 29419
BM_repeatTwoPageString/0 268895 ns 133951 ns 5542
BM_repeatTwoPageString/1 273066 ns 136871 ns 4060
BM_throughputForTransportAndBytes/0/64 41647 ns 20978 ns 31161
BM_throughputForTransportAndBytes/1/64 50865 ns 26653 ns 27674
BM_throughputForTransportAndBytes/0/1024 45359 ns 22866 ns 36708
BM_throughputForTransportAndBytes/1/1024 58353 ns 30732 ns 24405
BM_throughputForTransportAndBytes/0/2048 42337 ns 21340 ns 31918
BM_throughputForTransportAndBytes/1/2048 54608 ns 28429 ns 26312
BM_throughputForTransportAndBytes/0/4096 48556 ns 24274 ns 36713
BM_throughputForTransportAndBytes/1/4096 63926 ns 33302 ns 21678
BM_throughputForTransportAndBytes/0/8182 61992 ns 30967 ns 31588
BM_throughputForTransportAndBytes/1/8182 76709 ns 39386 ns 16124
BM_throughputForTransportAndBytes/0/16364 59111 ns 27146 ns 21538
BM_throughputForTransportAndBytes/1/16364 99768 ns 51025 ns 14223
BM_throughputForTransportAndBytes/0/32728 81425 ns 36794 ns 19077
BM_throughputForTransportAndBytes/1/32728 145483 ns 69133 ns 10000
BM_throughputForTransportAndBytes/0/65535 250483 ns 121279 ns 5994
BM_throughputForTransportAndBytes/1/65535 436443 ns 210857 ns 4502
BM_throughputForTransportAndBytes/0/65536 242461 ns 117834 ns 9015
BM_throughputForTransportAndBytes/1/65536 412841 ns 199778 ns 3333
BM_throughputForTransportAndBytes/0/65537 348937 ns 158662 ns 5700
BM_throughputForTransportAndBytes/1/65537 485328 ns 219897 ns 3345
BM_repeatBinder/0 149947 ns 81256 ns 7093
BM_repeatBinder/1 142770 ns 77031 ns 7460
Future considerations:
- what about other socket types (not UDS)
- control for binder scheduling hints
- more optimizations in libbinder
Bug: 182940634
Test: binderRpcBenchmark (results above)
Change-Id: I0db9a95d9336b6f943da9efe59ef7736a65f90e4
diff --git a/libs/binder/tests/IBinderRpcBenchmark.aidl b/libs/binder/tests/IBinderRpcBenchmark.aidl
index 1457422..2baf680 100644
--- a/libs/binder/tests/IBinderRpcBenchmark.aidl
+++ b/libs/binder/tests/IBinderRpcBenchmark.aidl
@@ -17,4 +17,5 @@
interface IBinderRpcBenchmark {
@utf8InCpp String repeatString(@utf8InCpp String str);
IBinder repeatBinder(IBinder binder);
+ byte[] repeatBytes(in byte[] bytes);
}