Firefox OS/Performance/Datazilla
Datazilla
This page details Datazilla and how we use it to triage performance problems in Firefox OS.
Collection
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.
Current Tests
- 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
Gaia Tests
- 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.
- 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.
Triaging Regressions
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.
Git Bisect
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
Profiling
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
Resources
- 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/