Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f859b257 authored by Piyush Mehrotra's avatar Piyush Mehrotra
Browse files

Control buffer size via server flags when writing to pipes in Full Backup flow.

Reasoning behind making buffer size configurable -
- In PerformFullTransportBackupTask (PFTBT) ->
    * PFTBT calls Transport#sendBackupData() everytime it writes buffer to the write end of the pipe (which is then read by the transport). That method is invoked through binder, which introduces some overhead. Current buffer size of 8KB means that for 25MB of backup data, PFTBT does a minimum of 3200 binder calls. Increasing the buffer size to 64KB, the number of binder call reduces to 400.
- In FullBackupUtils ->
    * FullBackupUtils#routeSocketDataToOutput() routes the data from BackupAgent to FullBackupEngine. Linux pipe2 implementation of Android has default size of 64KB. Increasing the buffer size in FullBackupUtils from 32KB to 64KB will result in optimal performance for piping the data, as buffer size will match input pipe's buffer.

Bug: b/265976737
Test: atest BackupAndRestoreFeatureFlagsTest
    - Manual testing for the performance impact
Change-Id: I729e0a5857e254eb9451eecf6fd9e58ac0511eb8
parent 796c571a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment