Performance:Tinderbox Tests
Original document imported from http://www.mozilla.org/performance/tinderbox-tests.html and original author is Chris McAfee <mcafee@netscape.com>.
Notes before starting
- When running these tests on your local machine, be sure to turn off extra stuff to reduce noise in your results. This means, irc, browsers, aim, httpd, things like that.
- Test with an optimized build. --enable-optimize, --disable-debug
- Running X & twm will reduce gnome noise.
- Install the Time::HiRes perl module for better timer resolution (see
mozilla/tools/performance/startup/gettime.pl). - Set this pref for stdout test output: user_pref("browser.dom.window.dump.enabled", true);
- In the commands below,
<appname>isfirefoxorseamonkeyormozillaor whatever you're testing.
Ts: Startup time
This test passes in begin time as a cgi argument, and JS onload handler in startup-test.html computes the end time. The page is loaded 10 times, and the shortest startup time is used as the final score.
cvs co mozilla/tools/performance/startup startup-unix.pl <path>/dist/bin/<appname>
Txul: XUL window open time
10 windows are opened/closed and median and average times are printed.
<appname> -chrome "file://<path>/mozilla/xpfe/test/winopen.xul"
Tp, Tp2 and the Pageloader extension: Page load time
jrgm's pageload test. You need to set up a server to run this. The source code is at http://lxr.mozilla.org/mozilla/source/tools/page-loader/ but note that it relies on some outdated Perl modules. Point your browser at this server and it crunches for up to 15-20 min depending on your machine speed, and produces a graph and average time value.
If you have a slow machine (e.g. < 300MHz) you may need to increase the timeout value from 15000 to say 30000.
Alternatively, use darin's standalone Tp2 test: http://lxr.mozilla.org/mozilla/source/tools/performance/pageload/
Or rhelmer's pageloader extension: http://lxr.mozilla.org/mozilla/source/testing/tools/pageloader/
Tp2 runs inside the content area of the browser, while the pageloader extension runs without browser chrome. They are based on the same (Javascript) code, and both produce numbers suitable for reporting to Tinderbox or the graph server.
It is recommended that you save all of the sites you wish to test to a local webserver, so that the network and remote webservers don't introduce unwanted variance.
Tdhtml: DHTML performance
This test runs a number of DHTML testcases several times, then prints out median and average times for each testcase, as well as the raw data, and the geometric mean of the median times. To run, just load the test driver. The list of tests is also available.
Classic (refcnt) Bl/Lk: Bloat & Leak numbers
For a non-debug build, add this to your .mozconfig:
ac_add_options --enable-logrefcnt
and reconfigure and rebuild. Then run the app on the bloaturls list of urls with the environment variable XPCOM_MEM_REFCNT_LOG set to point to a file where to dump bloat an leak summaries:
export XPCOM_MEM_REFCNT_LOG=bloat.log <appname> resource:///res/bloatcycle.html
The size of the log file can easily exceeds several gigabytes on Linux and with a 32-bit browser build the above command may generate an error when the log size reaches 2GB:
File size limit exceeded
As a workaround use the following command to compress the log file:
export XPCOM_MEM_REFCNT_LOG=/dev/stdout <appname> resource:///res/bloatcycle.html | gzip > bloat.log.gz
If you want to compare two runs (e.g. test a change) do something like this:
cvs co mozilla/tools/tinderbox/bloatdiff.pl XPCOM_MEM_REFCNT_LOG=a.out <appname> resource:///res/bloatcycle.html **make change** XPCOM_MEM_REFCNT_LOG=b.out <appname> resource:///res/bloatcycle.html bloatdiff.pl a.out b.out
Trace-Malloc Bl/Lk: Bloat & Leak numbers
Add this to your .mozconfig:
mk_add_options MOZ_CO_MODULE="mozilla/tools/trace-malloc" ac_add_options --enable-trace-malloc
Then do:
cvs co mozilla/tools/trace-malloc
and rebuild. Then run the app on the bloaturls list of urls:
<appname> resource:///res/bloatcycle.html
Bloat and leak summaries dumped out to stdout. More info about both bloat tests in the leak brownbag.
Tr/Tgfx/Tsvg: Rendering Performance numbers
These numbers measure raw rendering speed, without network or layout overhead. See Mozilla2:Trender for more information.