introduce binderRpcBenchmark
VRRRRRRRRRRRRRRRRRMMMMMMM!!!
Some caveats:
- we are partially benchmarking the scheduler
- this is a microbenchmark
Results running on host (we'll want to watch and tune these on real
devices with core clamping and thermal throttling off):
-------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------
BM_getRootObject 45959 ns 39054 ns 18345
BM_pingTransaction 26128 ns 23360 ns 28705
BM_repeatString 394286 ns 200186 ns 3508
BM_repeatBinder 39357 ns 37437 ns 17705
Bug: 182940634
Test: run benchmark on host and on cuttlefish
Change-Id: I5084a00ddf207eaeb803da98587ca04df65add4d
diff --git a/libs/binder/tests/IBinderRpcBenchmark.aidl b/libs/binder/tests/IBinderRpcBenchmark.aidl
new file mode 100644
index 0000000..1457422
--- /dev/null
+++ b/libs/binder/tests/IBinderRpcBenchmark.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+interface IBinderRpcBenchmark {
+ @utf8InCpp String repeatString(@utf8InCpp String str);
+ IBinder repeatBinder(IBinder binder);
+}