This page details Datazilla and how we use it to triage performance problems in Firefox OS.
Data in Datazilla is collected from automated tests. Some of these tests reside within gaia in tests/performance, and there are also Python tests on github in the b2gperf repository. There is a Jenkins instance in Mountain View which runs the automated tests against physical devices. Tests are run against apps with data using https://github.com/mozilla/b2gpopulate.
- Cold Load Time: b2gperf measures time taken from launching an app to the apploadtime event firing. This generates app startup times which are useful for identifying some kinds of performance regressions, but which are much shorter than camera-based startup times measured by Eideticker. This is the exact same test as startup time, but it runs more iterations.
- Endurance: Gaia UI tests that perform the same few interactions repeatedly in order to identify memory leaks or performance issues. These are run infrequently due to the amount of time they take to run.
- FPS: b2gperf performs a smooth scroll/swipe against the app and measures the frames per second using Gecko
- Startup Time: This is gathered using the 'test-perf' make target with Gaia, and the data is submitted to Datazilla using b2gperf. The test-perf jobs can measure other arbitrary performance metrics that are designed by the test authors (like "rendering_WiFi_list_>_settings-panel-wifi-ready"); the job that submits data to datazilla can operate on arbitrary metric names without any changes to the datazilla infrastructure. All the logic which runs these tests is part of Gaia; the output of 'make test-perf' includes a JSON structure which b2gperf submits to datazilla.
Here is an example flow of an app using the startup time test today: Process Startup -> Start Timer -> Make API calls -> Onload Event (Fire startup time event) -> API calls return, app useable.
There are a few problems with this test:
- The time between Process Startup and starting the timer is not constant. Ideally we would start the timer before we run startup. I was informed that this was difficult. TODO: File a bug if this does not exist.
- The startup time can be taken before the app is really ready. There are bugs open to add "startup path done" tests for the various apps.
- Startup Path Done: Test which listens to a custom event of when the startup is done. Currently not implemented for every test. Triggered after the startup-path-done event.
- App Specific Tests: Each app may have it's own specific performance tests. See apps/communications/dialer/test/performance for more details.
apploadtime: The event which we listen on for Startup Time and Cold Load Time tests. Gaia fires the apploadtime event, after listening to the gecko mozbrowserloadend event. Happens after all deferred scripts are loaded. This is the same as the load event. (There is no load event on a moz browser). We have to look at the code for each app to see exactly when this happens.
Each point in datazilla has a gaia, gecko, and platform build revision id. You can use this information to triage and locate where the regression occurred.
You can use git bisect to narrow down the range between two datapoints. This is useful for finding offending gaia commits. You can select two adjacent ranges and git bisect from one to another. Git bisect tutorial: http://webchick.net/node/99
One way of doing this is to use the B2G profiler: https://github.com/mozilla-b2g/B2G/blob/master/profile.sh More information on profiling: https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler
- Datazilla: https://datazilla.mozilla.org/b2g/
- Read the docs: http://datazilla.readthedocs.org/en/latest/
- Github repository: https://github.com/mozilla/datazilla
- Gaia Perf Tests: https://github.com/mozilla-b2g/gaia/tree/master/tests/performance
- Python Perf Tests (b2gperf): https://github.com/mozilla/b2gperf/
- Running Gaia Perf Tests: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Gaia_performance_tests
- Jenkins Integration: http://qa-selenium.mv.mozilla.com:8080/view/B2G/job/b2g.unagi.mozril.gaia.master.mozperftest/