Firefox/Projects/StartupPerformance/MeasuringStartup: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with 'We've been using a method Vlad blogged about [http://blog.vlad1.com/2009/07/28/measuring-startup/ here]. The steps are below. # save [http://people.mozilla.com/~vladimir/misc/st…')
 
(Added section on Windows setup.)
Line 1: Line 1:
We've been using a method Vlad blogged about [http://blog.vlad1.com/2009/07/28/measuring-startup/ here]. The steps are below.
The following method is based on a [http://blog.vlad1.com/2009/07/28/measuring-startup/ blog post] byVlad. The steps are below.  


# save [http://people.mozilla.com/~vladimir/misc/startup.html this html file] somewhere locally
#save [http://people.mozilla.com/~vladimir/misc/startup.html this html file] somewhere locally  
# create a new profile, run Firefox with it at least once, so all files are created, etc
#create a new profile, run Firefox with it at least once, so all files are created, etc  
# execute this command, with your profile name substituted, and invoking firefox in a way appropriate for your platform:
#execute this command, with your profile name substituted, and invoking firefox in a way appropriate for your platform:


<code>
<code>./firefox -P YourProfileName -no-remote file:///..../startup.html#`python -c 'import time; print int(time.time() * 1000);'` </code><code></code>
./firefox -P YourProfileName -no-remote file:///..../startup.html#`python -c 'import time; print int(time.time() * 1000);'`
</code>


==Cold startup on Mac==
== Setup on Windows  ==
The following is specific to Mac OSX and is required to evict Firefox code pages from memory and clear the Unified Buffer Cache (UBC). <code>purge</code> does NOT do this.


<pre>
To run these tests on Windows, you can follow these steps (after step 1 and 2 above):<br>
#!/bin/sh
 
#Download and install [http://python.org/download/ Python].<br>
#Download and install [http://cygwin.com/ Cygwin]. The default settings should be sufficient.<br>
#Add python.exe or its containing folder to the PATH (or use the full path to the executable in the command below).<br>
#In the Cygwin console, run the following command:<br>
<pre>/cygdrive/c/.../firefox.exe -P YourProfileName -no-remote file:///C:/.../startup.html#`python.exe -c 'import t
ime; import sys; sys.stdout.write(str(int(time.time() * 1000)));'`
</pre>
Startup times using this method will be a little bloated due to the overhead introduced by the Cygwin console, but should still be reliable if compared with each other.<br>
 
== Cold startup on Mac  ==
 
The following is specific to Mac OSX and is required to evict Firefox code pages from memory and clear the Unified Buffer Cache (UBC). <code>purge</code> does NOT do this.
<pre>#!/bin/sh


FF=/Volumes/Fujitsu80Gb
FF=/Volumes/Fujitsu80Gb
Line 21: Line 31:


$FF/Minefield$*.app/Contents/MacOS/firefox-bin -no-remote -foreground -P clean file://$FF/startup.html#`python -c 'import time; print int(time.time() * 1000);'`
$FF/Minefield$*.app/Contents/MacOS/firefox-bin -no-remote -foreground -P clean file://$FF/startup.html#`python -c 'import time; print int(time.time() * 1000);'`
</pre>
</pre>  
 
This assumes that your removable media is at /dev/disk1s2.
This assumes that your removable media is at /dev/disk1s2.

Revision as of 23:44, 21 June 2010

The following method is based on a blog post byVlad. The steps are below.

  1. save this html file somewhere locally
  2. create a new profile, run Firefox with it at least once, so all files are created, etc
  3. execute this command, with your profile name substituted, and invoking firefox in a way appropriate for your platform:

./firefox -P YourProfileName -no-remote file:///..../startup.html#`python -c 'import time; print int(time.time() * 1000);'`

Setup on Windows

To run these tests on Windows, you can follow these steps (after step 1 and 2 above):

  1. Download and install Python.
  2. Download and install Cygwin. The default settings should be sufficient.
  3. Add python.exe or its containing folder to the PATH (or use the full path to the executable in the command below).
  4. In the Cygwin console, run the following command:
/cygdrive/c/.../firefox.exe -P YourProfileName -no-remote file:///C:/.../startup.html#`python.exe -c 'import t
ime; import sys; sys.stdout.write(str(int(time.time() * 1000)));'`

Startup times using this method will be a little bloated due to the overhead introduced by the Cygwin console, but should still be reliable if compared with each other.

Cold startup on Mac

The following is specific to Mac OSX and is required to evict Firefox code pages from memory and clear the Unified Buffer Cache (UBC). purge does NOT do this.

#!/bin/sh

FF=/Volumes/Fujitsu80Gb

diskutil unmount force $FF
diskutil mount /dev/disk1s2

$FF/Minefield$*.app/Contents/MacOS/firefox-bin -no-remote -foreground -P clean file://$FF/startup.html#`python -c 'import time; print int(time.time() * 1000);'`

This assumes that your removable media is at /dev/disk1s2.