tools/performance/layout/perf-doc.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!-- This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 - License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
michael@0 4
michael@0 5 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
michael@0 6 <html>
michael@0 7 <head>
michael@0 8 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
michael@0 9 <meta name="Author" content="Marc Attinasi">
michael@0 10 <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
michael@0 11 <title>Performance Tools for Gecko</title>
michael@0 12 <style>
michael@0 13 BODY { margin: 1em 2em 1em 2em; background-color: bisque }
michael@0 14 H1, H2, H3 { background-color: black; color: bisque; }
michael@0 15 TABLE.boxed { border-width: 1; border-style: dotted; }
michael@0 16 </style>
michael@0 17 </head>
michael@0 18 <body>
michael@0 19
michael@0 20 <dl>&nbsp;
michael@0 21 <table WIDTH="100%" >
michael@0 22 <tr>
michael@0 23 <td>
michael@0 24 <center><img SRC="mozilla-banner.gif" height=58 width=600></center>
michael@0 25 </td>
michael@0 26 </tr>
michael@0 27 </table>
michael@0 28
michael@0 29 <center><table COLS=1 WIDTH="80%" class="boxed" >
michael@0 30 <tr>
michael@0 31 <td>
michael@0 32 <center>
michael@0 33 <h2>
michael@0 34 Performance Monitoring for Gecko</h2></center>
michael@0 35
michael@0 36 <center>
michael@0 37 <dd>
michael@0 38 <i>maintainer:&nbsp; marc attinasi&nbsp;</i></dd></center>
michael@0 39
michael@0 40 <center>
michael@0 41 <dd>
michael@0 42 <i><a href="mailto:attinasi@netscape.com">attinasi@netscape.com</a></i></dd></center>
michael@0 43 </td>
michael@0 44 </tr>
michael@0 45 </table></center>
michael@0 46
michael@0 47 <center>
michael@0 48 <dd>
michael@0 49 </dd></center>
michael@0 50 </dl>
michael@0 51
michael@0 52 <h3>
michael@0 53 Brief Overview</h3>
michael@0 54 Gecko should be <i>fast</i>. To help us make sure that it is we monitor
michael@0 55 the performance of the system, specifically in terms of Parsing, Content
michael@0 56 Creation, Frame Creation and Style Resolution - the core aspects of layout.
michael@0 57 Facilitating the monitoring of performance across build cycles is a small
michael@0 58 set of tools that work in conjunction with program output coming from the
michael@0 59 Mozilla or Viewer applications to produce tables of performance values
michael@0 60 and historical comparisons of builds analysed in the past. The tools, their
michael@0 61 dependencies and their general care and feeding are the topics of this
michael@0 62 document.
michael@0 63 <h4>
michael@0 64 Usage: A five-step plan to enlightenment</h4>
michael@0 65
michael@0 66 <ul>
michael@0 67 <li>
michael@0 68 First, the tools are all designed to run only on Windows. That is really
michael@0 69 a bummer, but since most of what we are measuring is XP it should not really
michael@0 70 matter. Get a Windows NT machine if you want to run the tools.</li>
michael@0 71
michael@0 72 <li>
michael@0 73 Next, you need a build that was created with performance monitoring enabled.
michael@0 74 To create such a build you must compile the Mozilla source with a special
michael@0 75 environment variable set. This environment variable turns on code that
michael@0 76 accumulates and dumps performance metrics data. The environment variable
michael@0 77 is: <b>MOZ_PERF=1</b>. Set this environment variable and then build all
michael@0 78 of Mozilla. If you can obtain a build that was built with MOZ_PERF=1 set
michael@0 79 then you can just use that build.</li>
michael@0 80
michael@0 81 <li>
michael@0 82 Third, run the script <b>perf.pl</b> to execute Viewer and run through
michael@0 83 the test sites gathering performance data.</li>
michael@0 84
michael@0 85 <li>
michael@0 86 Fourth, make sure the script completed and then open the resultant HTML
michael@0 87 files which is dropped in the Tables subdirectory.</li>
michael@0 88
michael@0 89 <li>
michael@0 90 Lasty, stare at the table and the values in it and decide if performance
michael@0 91 is geting better, worse, or staying the same.</li>
michael@0 92 </ul>
michael@0 93
michael@0 94 <h3>
michael@0 95 The PerfTools</h3>
michael@0 96 IMPORTANT: The tools created for monitoring performance
michael@0 97 are very tightly coupled to output from the layout engine. As Viewer (or
michael@0 98 Mozilla) is run it spits-out various timing values to the console. These
michael@0 99 values are captured to files, parsed and assembled into HTML tables showing
michael@0 100 the amount of CPU time dedicated to parsing the document, creating the
michael@0 101 content model, building the frame model, and resolving style during the
michael@0 102 building of the frame model. All of the scripts that make up the perftool
michael@0 103 are locate in the directory <tt>\mozilla\tools\performance\layout.</tt>
michael@0 104 Running them from another location <i>may</i> work, but it is best to run
michael@0 105 from there.
michael@0 106 <p>The perl script, <tt>perf.pl</tt>, is used to invoke Viewer and direct
michael@0 107 it to load various URLs. The URLs to load are contained in a text file,
michael@0 108 on per line. The file <tt>40-URL.txt</tt> is the baseline file and contains
michael@0 109 a listing of file-URLs that are static, meaning they never change, because
michael@0 110 they are snapshots of popular sites. As the script executes it does two
michael@0 111 things:
michael@0 112 <ol>
michael@0 113 <li>
michael@0 114 Invoke Viewer and feed it the URL-file, capturing the output to another
michael@0 115 file</li>
michael@0 116
michael@0 117 <li>
michael@0 118 Invoke other perl scripts to process the Viewer output into HTML tables</li>
michael@0 119 </ol>
michael@0 120 A set of perl scripts are used to parse the output of the Viewer application.
michael@0 121 These scripts expect the format of the performance data to be intransient,
michael@0 122 in other words, it should not change or the scripts need to be updated.
michael@0 123 Here are the files involved in parsing the data and generating the HTML
michael@0 124 table:
michael@0 125 <ul>
michael@0 126 <li>
michael@0 127 <tt><b>perf.pl</b> : </tt>The main script that orchestrates the running
michael@0 128 of viewer and the invocation of other scripts, and finally copies files
michael@0 129 to their correct final locations. An example of an invocation of the perf.pl
michael@0 130 script is: '<b><tt><font color="#000000">perl perf.pl</font><font color="#000099">
michael@0 131 Daily-0215 s:\mozilla\0215 cpu</font><font color="#000000">'</font></tt></b></li>
michael@0 132
michael@0 133 <ul>
michael@0 134 <li>
michael@0 135 <tt><b><font color="#000099">Daily-0215 </font></b><font color="#000000">is
michael@0 136 the name of the build and can be anything you like.</font></tt></li>
michael@0 137
michael@0 138 <li>
michael@0 139 <tt><b><font color="#000099">s:\mozilla\0215 </font></b><font color="#000000">is
michael@0 140 the location of the build. There must be a bin directory under the directory
michael@0 141 you specified, and it must contain the MOZ_PERF enabled build.</font></tt></li>
michael@0 142
michael@0 143 <li>
michael@0 144 <tt><b><font color="#000099">cpu </font></b><font color="#000000">indicates
michael@0 145 that we are timing CPU time. The other option is clock but that is not
michael@0 146 currently functional because of the clock resolution.</font></tt></li>
michael@0 147 </ul>
michael@0 148
michael@0 149 <li>
michael@0 150 <b><tt>Header.pl</tt></b> : a simple script that generates the initial
michael@0 151 portion of the HTML file that will show the performance data for the current
michael@0 152 build.</li>
michael@0 153
michael@0 154 <li>
michael@0 155 <tt><b>AverageTable2.pl</b> </tt>: a slightly more complicated script that
michael@0 156 parses the output from Viewer, accumulates data for averaging, and generates
michael@0 157 a row in the HTML table initialized by header.pl. This file is <b>must</b>
michael@0 158 be modified if the performance data output fromat changes.</li>
michael@0 159
michael@0 160 <li>
michael@0 161 <tt><b>Footer.pl</b> </tt>: a simple script that inserts the last row in
michael@0 162 the HTML table, the averages row. It also terminates the table and ends
michael@0 163 the HTML tag.</li>
michael@0 164
michael@0 165 <li>
michael@0 166 <tt><b>GenFromLogs.pl</b> </tt>: a script that generates the HTML table
michael@0 167 from already existing logs. This is used to regenerate a table after the
michael@0 168 QA Partner script has run, in case the table file is lost or otherwise
michael@0 169 needs to be recreated. Also, if old logs are kept, they can be used to
michael@0 170 regenerate their corresponding table.</li>
michael@0 171
michael@0 172 <li>
michael@0 173 <b><tt>Uncombine.pl</tt></b> : a script that breaks up a single text file
michael@0 174 containing all of the timing data for all of the sites into a separate
michael@0 175 file for each individual site.</li>
michael@0 176
michael@0 177 <li>
michael@0 178 <b><tt>History.pl</tt></b> : a script that generates an HTML file showing
michael@0 179 historical comparison of average performance values for current and previous
michael@0 180 builds.</li>
michael@0 181 </ul>
michael@0 182
michael@0 183 <h3>
michael@0 184 The URLs</h3>
michael@0 185 It is critical that the URLs that we load while measuring performance do
michael@0 186 not change. This is because we want to compare performance characteristics
michael@0 187 across builds, and if the URLs changed we could not really make valid comparisons.
michael@0 188 Also, as URLs change, they exercise different parts of the application,
michael@0 189 so we really want a consistent set or pages to measure performance against.
michael@0 190 The builds change, the pages do not.
michael@0 191 <p>On February 3, 2000 the top 40 sites were 'snaked' using the tool WebSnake.
michael@0 192 These sites now reside in disk-files and are loaded from those files during
michael@0 193 the load test. The file <tt>40-URL.txt</tt> contains a listing of the file-URLs
michael@0 194 created from the web sites. The original web sites should be obvious from
michael@0 195 the file-URLs.
michael@0 196 <br>&nbsp;
michael@0 197 <blockquote><i><b>NOTE</b>: There are some links to external images in
michael@0 198 the local websites. These should have been resolved by WebSnake but were
michael@0 199 not for some reason. These should be made local at some point so we can
michael@0 200 run without a connection to the internet.</i></blockquote>
michael@0 201
michael@0 202 <h3>
michael@0 203 Historical Data and Trending</h3>
michael@0 204 Historical data will be gathered and presented to make it easy for those
michael@0 205 concerned to see how the relative performance of various parts of the product
michael@0 206 change over time. This historical data is kept in a flat file of comma-delimited
michael@0 207 values where each record is indexed by the pull-date/milestone and buildID
michael@0 208 (note that the buildID is not always reliable, however the pull-date/milestone
michael@0 209 is provided by the user when the performance package is run, so it can
michael@0 210 be made to be unique). The Historical Data and Trending table will show
michael@0 211 the averages for Parsing, Content Creation, Frame Creation, Style Resolution,
michael@0 212 Reflow, Total Layout and Total Page Load time for each build, along with
michael@0 213 a simple bar graph representation of each records weight relative to the
michael@0 214 other records in the table. At a later this can be extended to trend individual
michael@0 215 sites, however for most purposes the roll-up of overall averages is sufficient
michael@0 216 to track the performance trends of the engine.
michael@0 217 <h3>
michael@0 218 The Execution Plan</h3>
michael@0 219 Performance monitoring will be run on a weekly basis, and against all Milestone
michael@0 220 builds. The results of the runs will be published for all interested parties
michael@0 221 to see. Interested and/or responsible individuals will review the performance
michael@0 222 data to raise or lower developer awareness of performance problems and
michael@0 223 issues as they arise.
michael@0 224 <p>Currently, the results are published weekly at <a href="http://techno/users/attinasi/publish">http://techno/users/attinasi/publish</a>
michael@0 225 <h3>
michael@0 226 Revision Control and Archiving</h3>
michael@0 227 The scripts are checked into cvs in the directory \mozilla\tools\performance\layout.
michael@0 228 The history.txt file is also checked in to cvs after every run, as are
michael@0 229 the tables produced by the run. Commiting the files to cvs is a manual
michael@0 230 operation and should be completed only when the data has been analysed
michael@0 231 and appears valid. Be sure to:
michael@0 232 <ol>
michael@0 233 <li>
michael@0 234 Commit history.txt after each successful run.</li>
michael@0 235
michael@0 236 <li>
michael@0 237 Add / commit the new table and new trend-table after each successful run
michael@0 238 (in the Tables subdirectory).</li>
michael@0 239
michael@0 240 <li>
michael@0 241 Commit any chages to the sciripts or this document.</li>
michael@0 242 </ol>
michael@0 243
michael@0 244 <hr WIDTH="100%">
michael@0 245 <h3>
michael@0 246 History:</h3>
michael@0 247
michael@0 248 <table BORDER WIDTH="50%" >
michael@0 249 <tr>
michael@0 250 <td WIDTH="25%">02/04/2000</td>
michael@0 251
michael@0 252 <td>Created - attinasi</td>
michael@0 253 </tr>
michael@0 254
michael@0 255 <tr>
michael@0 256 <td>03/17/2000</td>
michael@0 257
michael@0 258 <td>Removed QA Partner stuff - no longer used</td>
michael@0 259 </tr>
michael@0 260
michael@0 261 <tr>
michael@0 262 <td></td>
michael@0 263
michael@0 264 <td></td>
michael@0 265 </tr>
michael@0 266
michael@0 267 <tr>
michael@0 268 <td></td>
michael@0 269
michael@0 270 <td></td>
michael@0 271 </tr>
michael@0 272
michael@0 273 <tr>
michael@0 274 <td></td>
michael@0 275
michael@0 276 <td></td>
michael@0 277 </tr>
michael@0 278 </table>
michael@0 279
michael@0 280 </body>
michael@0 281 </html>

mercurial