tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

awsy.rst (8897B)


      1 ====
      2 AWSY
      3 ====
      4 
      5 Are We Slim Yet project (commonly known as AWSY) tracks memory usage across builds.
      6 
      7 On treeherder, the AWSY builds are listed in subgroups of `SY`.
      8 
      9 AWSY tests consist of three types: TP5*, TP6, and Base Memory Usage.
     10 
     11 *\*TP5 tests are out of date and no longer maintained. These tests are scheduled to be removed:* https://bugzilla.mozilla.org/show_bug.cgi?id=1712406
     12 
     13 Awsy tests
     14 ----------
     15 
     16 
     17 .. dropdown:: base (FF)
     18   :class-container: anchor-id-base-Awsy-tests
     19 
     20   * Command to Run Locally
     21 
     22   .. code-block::
     23 
     24      ./mach awsy-test --base
     25 
     26   **Owner**: :mccr8 and Perftest Team
     27 
     28   * **Test Task**:
     29      * test-linux1804-64-clang-trunk-qr/opt
     30            * awsy-base: None
     31            * awsy-base-dmd: None
     32 
     33      * test-linux1804-64-qr/opt
     34            * awsy-base: None
     35            * awsy-base-dmd: None
     36 
     37      * test-linux1804-64-shippable-qr/opt
     38            * awsy-base: trunk
     39            * awsy-base-dmd: None
     40 
     41      * test-macosx1470-64-shippable/opt
     42            * awsy-base: trunk
     43            * awsy-base-dmd: None
     44 
     45      * test-windows11-64-24h2-shippable/opt
     46            * awsy-base: trunk
     47            * awsy-base-dmd: None
     48 
     49      * test-windows11-64-24h2/opt
     50            * awsy-base: None
     51            * awsy-base-dmd: None
     52 
     53 
     54 .. dropdown:: dmd (FF)
     55   :class-container: anchor-id-dmd-Awsy-tests
     56 
     57   * Command to Run Locally
     58 
     59   .. code-block::
     60 
     61      ./mach awsy-test --dmd
     62 
     63   **Owner**: :mccr8 and Perftest Team
     64 
     65   * **Test Task**:
     66      * test-linux1804-64-clang-trunk-qr/opt
     67            * awsy-base-dmd: None
     68            * awsy-dmd: None
     69 
     70      * test-linux1804-64-qr/opt
     71            * awsy-base-dmd: None
     72            * awsy-dmd: None
     73 
     74      * test-linux1804-64-shippable-qr/opt
     75            * awsy-base-dmd: None
     76            * awsy-dmd: None
     77 
     78      * test-macosx1470-64-shippable/opt
     79            * awsy-base-dmd: None
     80            * awsy-dmd: None
     81 
     82      * test-windows11-64-24h2-shippable/opt
     83            * awsy-base-dmd: None
     84            * awsy-dmd: None
     85 
     86      * test-windows11-64-24h2/opt
     87            * awsy-base-dmd: None
     88            * awsy-dmd: None
     89 
     90 
     91 .. dropdown:: tp5 (FF)
     92   :class-container: anchor-id-tp5-Awsy-tests
     93 
     94   * Command to Run Locally
     95 
     96   .. code-block::
     97 
     98      ./mach awsy-test --tp5
     99 
    100   **Owner**: :mccr8 and Perftest Team
    101 
    102   * **Test Task**:
    103      * test-linux1804-64-clang-trunk-qr/opt
    104 
    105      * test-linux1804-64-qr/opt
    106 
    107      * test-linux1804-64-shippable-qr/opt
    108 
    109      * test-macosx1470-64-shippable/opt
    110 
    111      * test-windows11-64-24h2-shippable/opt
    112 
    113      * test-windows11-64-24h2/opt
    114 
    115 
    116 .. dropdown:: tp6 (FF)
    117   :class-container: anchor-id-tp6-Awsy-tests
    118 
    119   * Command to Run Locally
    120 
    121   .. code-block::
    122 
    123      ./mach awsy-test 
    124 
    125   **Owner**: :mccr8 and Perftest Team
    126 
    127   * **Test Task**:
    128      * test-linux1804-64-clang-trunk-qr/opt
    129            * awsy-tp6: None
    130 
    131      * test-linux1804-64-qr/opt
    132            * awsy-tp6: None
    133 
    134      * test-linux1804-64-shippable-qr/opt
    135            * awsy-tp6: trunk
    136 
    137      * test-macosx1470-64-shippable/opt
    138            * awsy-tp6: trunk
    139 
    140      * test-windows11-64-24h2-shippable/opt
    141            * awsy-tp6: trunk
    142 
    143      * test-windows11-64-24h2/opt
    144            * awsy-tp6: None
    145 
    146 
    147 
    148 
    149 Running AWSY Locally
    150 *********************
    151 
    152 Running tests locally is most likely only useful for debugging what is going on in a test,
    153 as the test output is only reported as raw JSON. The CLI is documented via:
    154 
    155 .. code-block:: bash
    156 
    157    ./mach awsy-test --help
    158 
    159 *Currently all tests will download TP5 even if it is not used, see:* https://bugzilla.mozilla.org/show_bug.cgi?id=1683920
    160 
    161 TP5 tests
    162 =========
    163 
    164 .. code-block:: bash
    165 
    166    ./mach awsy-test --tp5
    167 
    168 TP6 tests
    169 =========
    170 
    171 .. code-block:: bash
    172 
    173    ./mach awsy-test
    174 
    175 Base Memory Usage tests
    176 ========================
    177 
    178 .. code-block:: bash
    179 
    180    ./mach awsy-test --base
    181 
    182 Running AWSY on Try
    183 ********************
    184 
    185 AWSY runs can be generated through the mach try fuzzy finder:
    186 
    187 .. code-block:: bash
    188 
    189    ./mach try fuzzy
    190 
    191 A query for "awsy" will return all AWSY tests. The default test is TP5, TP6 and Base test names will contain `tp6` and `base`, respectively.
    192 
    193 The following documents all tests we currently run for AWSY.
    194 *The following content was migrated from* https://wiki.mozilla.org/AWSY/Tests *and will be updated to clarify TP5/TP6 tests vs Base tests:* https://bugzilla.mozilla.org/show_bug.cgi?id=1714600
    195 
    196 
    197 TP5/TP6 Tests
    198 **************
    199 
    200 The following tests exist for both TP5 and TP6. Running `./mach awsy-test` by default will run TP6 tests*.
    201 To run TP5 tests, add the `--tp5` flag: `./mach awsy-test --tp5`
    202 
    203 *\*TP5 tests are out of date and no longer maintained. These tests are scheduled to be removed:* https://bugzilla.mozilla.org/show_bug.cgi?id=1712406
    204 
    205 
    206 Explicit Memory
    207 ================
    208 
    209 * This is memory explicitly reported by a memory reporter. It includes all the memory allocated via explicit calls to heap allocation functions (such as malloc and new), and some (only that covered by memory reporters) of the memory allocated via explicit calls to non-heap allocation functions (such as mmap and VirtualAlloc).
    210 
    211 **Possible regression causes**
    212 
    213 * A regression in this usually means a new feature is using or retaining more memory and should be looked at. These are easier to diagnose because we can compare memory reports.
    214 
    215 See the `about:memory` `mdn page <https://developer.mozilla.org/docs/Mozilla/Performance/about:memory#Explicit_Allocations>`__ for more details.
    216 
    217 
    218 Heap Unclassified
    219 ==================
    220 
    221 *to do: add test definition*
    222 
    223 
    224 Images
    225 =======
    226 
    227 * This is a subset of the "explicit" measurement that focuses on memory used to render images.
    228 
    229 **Possible regression causes**
    230 
    231 * A regression in this can indicate leaks or poor memory usage in the image subsystem. In the past this was a persistent problem.
    232 
    233 
    234 JS
    235 ====
    236 
    237 *to do: add test definition*
    238 
    239 
    240 Resident Memory
    241 ================
    242 
    243 * This is a higher level measurement provided by the operating system. We sum the "resident" memory (`RSS <https://en.wikipedia.org/wiki/Resident_set_size>`_) with the `resident-unique <https://en.wikipedia.org/wiki/Unique_set_size>`_ memory of the content processes. It's pretty noisy and large so it's not very useful in detecting smaller regressions.
    244 
    245 **Possible regression causes**
    246 
    247 * Regressions in this often track regressions in explicit and heap unclassified. If we see a regression in resident, but not in other reports this can indicate we are leaking untracked memory (perhaps through shared memory, graphics allocations, file handles, etc).
    248 
    249 
    250 Base Content Tests
    251 *******************
    252 
    253 * An updated test focused on supporting Fission. This measures the base overhead of an empty content process. It tracks resident unique, heap unclassified, JS, and explicit memory metrics as well as storing full memory reports as artifacts. The median value for each metric is used from across all content processes. It has much lower thresholds for alerting and is recorded in `Perfherder <https://wiki.mozilla.org/EngineeringProductivity/Projects/Perfherder>`_.
    254 
    255 
    256 Base Content Explicit
    257 ======================
    258 
    259 **Possible regression causes**
    260 
    261 A change has caused more JavaScript to load at startup or into blank pages.
    262 
    263 * **Common solution**: lazily load any new modules you rely on
    264 * **Common solution**: Split your code out to only load what is minimally needed initially. You modified the JS engine and it's using more memory
    265 * **Common solution**: Attempt to reduce your object size for the common case, these tend to add up! You implemented a new feature in JavaScript
    266 * **Common solution**: Write the majority (or all of it) in compiled code (C++/Rust). This will reduce overhead and generally improve performance.
    267 
    268 
    269 Base Content Heap Unclassified
    270 ===============================
    271 
    272 * The "heap-unclassified" value represents heap-allocated memory that is not measured by any memory reporter. This is typically 10-20% of "explicit".
    273 
    274 
    275 **Possible regression causes**
    276 
    277 * A regression in this can indicate that we're leaking memory or that additional memory reporters should be added.
    278 * An improvement can indicate that leaks have been fixed or that we added new memory reporters.
    279 
    280 See the `about:memory` `mdn page <https://developer.mozilla.org/docs/Mozilla/Performance/about:memory#Explicit_Allocations>`__ for more details.
    281 
    282 
    283 Base Content JS
    284 ================
    285 
    286 * This is the "js-main-runtime/" value in `about:memory` which is all the memory attributed to the javascript engine.
    287 
    288 **Possible regression causes**
    289 
    290 * A regression in this number can indicate leaks in the JS engine, optimizations that take performance into consideration at the expense of more memory, or problems with the garbage collector.
    291 
    292 
    293 Base Content Resident Unique Memory
    294 ====================================
    295 
    296 *to do: add test definition*
    297 
    298 
    299 Other references
    300 -----------------
    301 
    302 `Are We Slim Yet MDN web docs <https://developer.mozilla.org/en-US/docs/Mozilla/Performance/AWSY>`_