Profilo – A Facebook Open Source Android Performance Library
On March 2017, Facebook open-sourced Profilo. An Android Performance Library.
Mobile Application Performance
Every developer or company who is engaged in mobile application development should have faced performance issues. Whether it is users complainig of poor performances or slow devices or features for obscure reasons. And when these appears, it is always hard to investigate the problem and find the source. Tools exists but they usually show their limits and finding the root cause is a rather slow process.
Metrics like CPU time or server data are not always sufficient to find the issue on the user mobile. So, the solution is to try to reproduce the regression locally with tools like Systrace for example. A time consuming and not 100% accurate process. Even more when slowdowns are reported only on a small number on users or devices.
Cloud solutions also exists for basic performance monitoring. And if you don’t mind sharing your user’s crash and performance reports with Google, you can go for Crashlytics for example. Bet they don’t use it at Facebook…
In this context, some of the Facebook engineers working on mobile application built Profilo, a mobile performance tracing library.
It was built with high-througput as a priority. It allowed them to collect telemetry at a 3000 per second rate with minimal data loss. The configuration system is quite powerful too, as it allows to remotely change the trace config, to track only specific devices, or to perform on-demand A/B tests.
Profilo is now used to perform much faster regression testing between application versions ans identifying new tpes of regressions or issues like application fluidity.
A Deeper Dive on Android Performance Monitoring
In order to enhance monitoring precision, they developped their own Java stack unwinder. Thus they could collect data in a different way than witth the official Java APIs (true CPU usage, no class or function names on trace data itself).
They also developped ways to capture systrace telemetry, and undersatnd what Android frameworks and the JVM are doing on behalf of our app. Plus Garbage Collection and VM-specific events.
Facebook engineers choosed to open source the project (starting with the Android library) to “share their methodologies and tools“, and to “enable more mobile engineers to work on production performance traces effectively and together build better workflows and analysis systems”
Article @ Facebook Code