mobile/docs/root/development/performance/cpu_battery_impact.rst
.. _dev_performance_cpu_battery:
We utilized 2 apps (1 control, 1 variant) on each platform to validate performance using the native networking stacks versus Envoy Mobile:
200ms to an endpoint without Envoy compiled in the app.All request/response caching was disabled.
Results
iOS
---
Valid through SHA :tree:`v0.2.3.03062020 <v0.2.3.03062020>`.
Envoy:
- Avg CPU: ~4%
- Avg memory: 46MB
- Battery: Negligible
Control:
- Avg CPU: ~4%
- Avg memory: 29MB
- Battery: Negligible
**Based on these results, control and Envoy are relatively similar with a slight increase in memory using Envoy.**
Android
-------
Valid through SHA :tree:`v0.3.0.05122020 <v0.3.0.05122020>`.
Envoy:
- Avg CPU: ~5.16%
- Avg memory: 109MB
- Battery: 0.2%/min
Control:
- Avg CPU: ~2.94%
- Avg memory: 52MB
- Battery: 0.23%/min
**Based on these results, control and Envoy are relatively similar.**
Experimentation method
The sample apps checked into
this analysis repository <https://github.com/rebello95/EnvoyMobileAnalysis/tree/v0.2.3.03062020>_
were used to run the analysis outlined in this document.
For the analysis, we utilized Xcode Instruments to monitor the 2 sample apps while they ran in the foreground for a few minutes.
Control requests were made using URLSession, with the session
configuration's cache set to nil (disabling caching).
Variant requests were made using the EnvoyClient.
Both apps were run (one at a time) on a physical device (iPhone XS, iOS 13.3.1) while running Instruments.
Additional screenshots from the analysis are available on the
release <https://github.com/rebello95/EnvoyMobileAnalysis/releases/tag/v0.2.3.03062020>_.
Modified versions of the "hello world" example apps were used to run these experiments:
Android control app <8636711/examples/kotlin/control>Android Envoy app <8636711/examples/kotlin/hello_world>Getting the build:
bazel build android_dist --config=android --fat_apk_cpu=armeabi-v7abazel mobile-install //examples/kotlin/control:hello_control_ktbazel mobile-install //examples/kotlin/hello_world:hello_envoy_kt --fat_apk_cpu=armeabi-v7aBattery usage experiment steps:
Alternative profiling methods tried:
AccuBattery <https://play.google.com/store/apps/details?id=com.digibites.accubattery&hl=en_US>_:
We were unable to get the running time of a given application on AccuBattery to more accurately identify battery usage per minute
Battery Historian <https://github.com/google/battery-historian>_:
We were unable to get reliable data using this method. Often times, the battery usage of an application appears to use no batteries
CPU usage experiment steps:
adb shell top -H | grep envoy to get the CPU usage of the application (the -H flag displays the running threads)Open issues
For current issues with CPU/battery, please see issues with the
`perf/cpu label <https://github.com/envoyproxy/envoy-mobile/labels/perf%2Fcpu>`_.