Firefox OS/Performance/Tools/Data Sources and Tools for FxOS Perfomance Optimization

From MozillaWiki
Jump to navigation Jump to search

Introduction

Good performance data is necessary for developers to optimize, debug regressions, and to learn the best practices for developing on our platform. Therefore it is essential that the Firefox OS Performance team take a look at all of the available performance related data to identify what we have to work with right now and what other performance data we should work to expose in the future.

Performance Data Sources

Below is a list of all of the performance data sources we would like to expose to app developers to help with optimization.

Memory

  • Global memory usage.
  • Per-process memory usage broken down into USS, RSS, JS objects, etc.
  • GC events.
  • Any relavent GC stats (e.g. how much memory is each generation group).

Processes

  • Main thread stalls.
  • App startup sequence events.
  • Arbitrary events from app JS.
  • I/O events (e.g. file load start, file load end).

Javascript

  • JS parse start and end.
  • JS JIT start and end, both baseline and ion.
  • JS JIT bailouts.
  • JS JIT warnings/errors (i.e. JS code from line X to Y has unstable type flow).
  • JS IC invalidations.



On Device Data

Currently, Firefox OS posesses the ability to report out a number of performance related statistics in realtime. Figure 1 illustrates the current organization of the data gathering and expropriation.

OnDeviceInstrumentation.png

Figure 1

The data is gathered by a set of observers that watch for events/changes in their respective performance areas and then report the changed stats via the observe message system. The sampling profiler and the child process actors set up observers to receive these events. The other main source of data is the memory sub-system which is polled by both the profiler and child actors to get memory statistics for each process.

The child process actors handle sending all of the performance data to the parent process