A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://firefox-source-docs.mozilla.org/performance/perfstats.html below:

Website Navigation


PerfStats — Firefox Source Docs documentation

PerfStats

PerfStats is a framework for the low-overhead selective collection of internal performance metrics. The results are accessible through ChromeUtils, Browsertime output, and in select performance tests.

Adding a new PerfStat

Define the new PerfStat by adding it to this list in PerfStats.h. Then, in C++ code, wrap execution in an RAII object, e.g.

PerfStats::AutoMetricRecording<PerfStats::Metric::MyMetric>()

or call the following function manually:

PerfStats::RecordMeasurement(PerfStats::Metric::MyMetric, Start, End)

For incrementing counters, use the following:

PerfStats::RecordMeasurementCount(PerfStats::Metric::MyMetric, incrementCount)

Here’s an example of a patch where a new PerfStat was added and used.

Enabling collection

To enable collection, use ChromeUtils.SetPerfStatsCollectionMask(MetricMask mask), where mask=0 disables all metrics and mask=0xFFFFFFFF enables all of them. MetricMask is a bitmask based on Metric, i.e. Metric::LayerBuilding (2) is synonymous to 1 << 2 in MetricMask.

Accessing results

Results can be accessed with ChromeUtils.CollectPerfStats(). The Browsertime test framework will sum results across processes and report them in its output. The raptor-browsertime Windows essential pageload tests also collect all PerfStats.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3