Reputation: 41
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)
Upvotes: 2
Views: 1879
Reputation: 2036
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.
Upvotes: 2