I write a IPC framework using domain socket and protobuf. I compared binder with my IPC Framework in my x86 ubuntu and anbox on it.
when data size between 8 byte ~ 4K, the performance has no difference.when data size large than 32K, My IPC Framework is better than binder.I think bidner transfer data only copy once,while domain socket copy it two times.How Can I explain the result?(anbox should not bring performance loss)
Asked
Active
Viewed 1,337 times
2

rockycai
- 41
- 1
- 8
-
Which Binder did you check? The Framework Binder needs to marshall/unmarshall data and the Hardware Binder does not. – Simpl Aug 19 '19 at 15:32
-
Framework binder I choice, although it need marshall and unmarshall data using parcel, I think the performance should not like this – rockycai Aug 20 '19 at 03:35
1 Answers
2
Binder with AIDL
will marshall and unmarshal data before copying it. If your IPC does not require that step and copies raw data you have a clear speed benefit. Copying large chunks of data in Android is therefore not typically done via Binder.
If you switch to Hardware Binder with HIDL
and Fast Message Queues, things might look a little different. However, you cannot use HIDL
in the Framework Binder. So this might not be an option for you.

Simpl
- 1,938
- 1
- 10
- 21