Performance:Probes
Probing is the general concept of instrumenting code in a selective way to collect particular kinds of data. Probes can consist of special code compiled into a program, and/or a monitoring mechanism inserted by an external program.
We propose to build a system of probes to monitor Gecko performance, with a focus on breaking down time and space consumption by subsystem. The goal is to get results that are finer-grained than Tp/Tp2 etc, which measure the browser as a whole, but coarser-grained than profiling, which works at a per-function level and does not aggregate multiple functions that are parts of the same subsystem.
Contents
Requirements
Probes should be low impact when not in use. Ideally they would be zero impact when not in use, but this typically requires platform-specific and/or OS support. Impact needs to be minimal when in use.
Probes should be able to be enabled and used in both debugging and optimized builds. They do not need to be available in production builds (although it is useful sometimes, we don't need it to be a requirement).
Probing should be available on all supported platforms. It is allowable for the performance impact to be lower and the data quality to be better on some platforms.
It should be possible to monitor entry and exit from individual functions.
Probe timing data should be high resolution, to the microsecond level at least.
nsProbes
"nsProbes" is a proposal to insert probes programmatically; see [1] for details.
DTrace
DTrace [2] is a general dynamic tracing framework produced by Sun. It is a powerful system that includes OS kernel integration and a scripting language. Mozilla integration for static probing has been submitted as a patch; see 370906.
DTrace is only fully functional for Solaris, but is being worked on for FreeBSD and is expected to be part of Mac OS X 10.5 (Leopard).
Projects
This section lists specific projects using probes.
Memory leak tracking
Chrome performance
Javascript probes could be used to investigate overhead due to chrome.