This page explains how optimize the performance the Firefox code base
General Performance references¶
Tips on generating valid performance metrics by benchmarking
GPU Performance Tips for reducing impacts on browser performance in front-end code.
Automated Performance testing and Sheriffing Information on automated performance testing and sheriffing at Mozilla.
Performance best practices for Firefox front-end engineers Tips for reducing impacts on browser performance in front-end code.
Reporting a performance problem A user friendly guide to reporting a performance problem. A development environment is not required.
Scroll Linked Effects Information on scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques.
Memory profiling and leak detection tools¶
The Developer Tools Memory panel supports taking heap snapshots, diffing them, computing dominator trees to surface “heavy retainers”, and recording allocation stacks.
About:memory about:memory is the easiest-to-use tool for measuring memory usage in Mozilla code, and is the best place to start. It also lets you do other memory-related operations like trigger GC and CC, dump GC & CC logs, and dump DMD reports. about:memory is built on top of Firefox’s memory reporting infrastructure.
DMD is a tool that identifies shortcomings in about:memory’s measurements, and can also do multiple kinds of general heap profiling.
AWSY (are we slim yet?) is a memory usage and regression tracker.
Bloatview prints per-class statistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class. It is used as part of Mozilla’s continuous integration testing.
Refcount Tracing and Balancing are ways to track down leaks caused by incorrect uses of reference counting. They are slow and not particular easy to use, and thus most suitable for use by expert developers.
Leak Gauge can be generated and analyzed to in various ways. In particular, they can help you understand why a particular object is being kept alive.
LogAlloc is a tool that dumps a log of memory allocations in Gecko. That log can then be replayed against Firefox’s default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload.