Firefox/Projects/Startup Time Improvements: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
(54 intermediate revisions by 9 users not shown)
Line 1: Line 1:
__NOTOC__
= Overview =
= Overview =
'''Project lead:''' Dietrich Ayala <br/>
'''Project members:''' Ryan Flint, Drew Willcoxon, David Dahl, Vlad Vukićević, Taras Glek, Joel Reymont, Ben Hsieh


'''Description:''' Investigate areas for improving startup time of the Mozilla platform, find & fix issues that help Fennec and WinCE.
'''Description:''' Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices.


'''Bugs:'''
'''Project lead:''' <br/>
* [http://tinyurl.com/ygbnzmd Open] (identified by "[ts]" in the whiteboard field)
'''Project members:''' Taras Glek,  Ben Hsieh, Steve Fink, Michael Wu, Shawn Wilsher
* [http://tinyurl.com/yjp8d6w Fixed]


'''Results'''
'''Bugs:''' [http://tinyurl.com/ygbnzmd Open] | [http://tinyurl.com/yjp8d6w Fixed] | [http://bit.ly/5t9fA9 Fixed in 3.6]


See results in the [http://people.mozilla.org/~dietrich/snapshot/ Performance Snapshot].
'''Results''': [http://graphs.mozilla.org/dashboard/snapshot/ Performance Snapshot] (snapshot numbers for last 7 days, and version comparisons)


= Projects =
'''Graphs:''' [http://bit.ly/5fjmP9 Windows XP] | [http://bit.ly/8FjKvj Windows Vista] | [http://bit.ly/7aHx3r Mac Leopard] | [http://bit.ly/8wUHGs Linux]


'''Areas of Work:'''
'''Status:''' [http://autonome.wordpress.com/tag/startup/ Weekly status updates]
* minification
 
** {{bug|524858}} - minify js
=Active Projects=
** {{bug|513132}} - minify css
<onlyinclude>
** {{bug|523479}} - minify extension's contents
{|border="1" cellspacing="0" cellpadding="2"
* file combining
!Estimated win
** {{bug|507101}} - combining js components
!Bug #
** {{bug|509755}} - put modules into a jar
!Summary
!Owner
!Status
!Notes
|-
|~10%
|[[Firefox/Projects/2010Q3_Dirty_Startup_Reduction|"Dirty Profile" Startup Reduction]]
|Constant startup relative to profile size
|Shawn Wilsher
|
|
|-
|significant
|{{bug|558200}}
|Extension profiler platform api
|Steve Fink
|
| There is an easy way to provide feedback to extension developers to help them figure out why their extension is misbehaving. We need to implement that ASAP, so typical firefox installs(with lots of extensions) can be fast
|}
</onlyinclude>
 
=Help Wanted/Onhold=
{|border="1" cellspacing="0" cellpadding="2"
!Estimated win
!Bug #
!Summary
!Owner
!Status
!Notes
|-
|~8%
|{{bug|561842}}
|Fold libraries into libxul
|Ted Mielczarek
|
|proof of concept done
|-
|up to 40%
|{{bug|531406}}
|Optimize code locality in binaries. Working on enabling pgo atm.
|Taras Glek
|
|Linux almost done, need to figure out integration. Windows proof of concept needs work.
See [http://blog.mozilla.com/tglek/2010/02/19/teaching-ld-to-optimize-binaries-for-startup/ blog post] for more details. Taras and Ehsan working on Windows locality improvements ({{bug|553721}}).
|-
|~10%
|{{bug|512584}}
|Fast paths for Cc/Ci
|
|
|Confirmed win. Unfortunately this approach touches a lot of sensitive code, might be easier to port js to not use Cc/Ci
|-
|TBD
|{{bug|513149}} {{bug|553456}}
|Speed up CSS parsing
|Zack Weinberg
|
|
|-
|significant
|{{bug|559663}}
|Measuring IOPs
|
|
|Our current infrastructure does not measure cold startup effectively, it should.
|
|-
|TBD
|{{bug|569629}}
|Get rid of static initializers
|
|
|These slowdown library loading, cause a lot of pagefaults on gcc platforms.
|}
 
 
Other efforts:
* {{bug|514083}} HFS+ compression on Mac OSX 10.6
 
'''Measurement & Testing Projects'''
* cold startup testing
** {{bug|532965}} - fix Mac cold startup test
** {{bug|522807}} - make windows cold startup test
 
* dirty profile testing
** {{bug|527596}} - dirty Tp
** {{bug|FILEME}} - test an all-dirty profile
 
=Future Projects=
 
* {{bug|523146}} - micro-benchmarking test framework
* {{bug|522375}} - built-in startup measurement
 
* {{bug|509755}} - put modules into a jar
* {{bug|FILEME}} - [https://bugzilla.mozilla.org/show_bug.cgi?id=279839#c29 string pool for jsxpcom]
* {{bug|FILEME}} - [https://bugzilla.mozilla.org/show_bug.cgi?id=279839#c29 string pool for jsxpcom]
* taking advantage of tracing
* taking advantage of tracing
** figure out where we're not tracing in the startup log
** figure out where we're not tracing in the startup log
** [http://blog.mozilla.com/dmandelin/2009/02/26/tracevis-performance-visualization-for-tracemonkey/ dmandelin's blog post]
** traceviz ({{bug|497999}})
** traceviz ({{bug|497999}})
* [[Firefox/Projects/Startup_Time_Improvements/Static_Build|static build]]
'''Measurement & Testing'''
* cold startup testing
** <strike>{{bug|510587}} - mac and linux</strike>
** {{bug|522807}} - windows
* dirty profile testing
** <strike>{{bug|414660}} - infrastructure & places</strike>
** {{bug|515540}} - dirty+cold startup
** {{bug|527596}} - dirty Tp (teehee)
** {{bug|FILEME}} - test an all-dirty profile
** {{bug|FILEME}} - other dirty profiles
* micro-benchmarking
** {{bug|523146}} - test framework
** {{bug|479528}} - for location bar
** {{bug|451607}} - for places UI
** {{bug|479528}} - for places SQL
** more, eg: test for opening the 80th tab
* built-in startup measurement ({{bug|522375}})
** user-runnable Ts script, paste into js console
** restarts browser, passing last known time
** loads data URI that reads startup time and prints it out
** record startup timestamp as a pref?
* timeline of the startup path (David, Vlad)
* timeline of the startup path (David, Vlad)
** Status: incomplete (held up on hangs, nspr changes)
** Status: incomplete (held up on hangs, nspr changes)
Line 56: Line 125:
** {{bug|503605}} visualization ([http://mozilla.ddahl.com/startup/timeline-similie.html Simile timeline], [http://people.mozilla.org/~dietrich/ddahl_sample_output.txt raw log])
** {{bug|503605}} visualization ([http://mozilla.ddahl.com/startup/timeline-similie.html Simile timeline], [http://people.mozilla.org/~dietrich/ddahl_sample_output.txt raw log])


'''Docs:'''
=Inactive Projects=
* write best practices recommendation
 
'''Inactive Projects'''


* {{bug|507101}} - combining js components
* minification
** {{bug|524858}} - minify js
** {{bug|513132}} - minify css
** {{bug|523479}} - minify extension's contents
* Mine the Ts DTrace viz/logs (Drew)
* Mine the Ts DTrace viz/logs (Drew)
** Status: complete, moved on to filesystem operations below
** Status: complete, moved on to filesystem operations below
Line 87: Line 158:
*** dead code finder
*** dead code finder


=Status Updates=
=Completed Projects=


* [http://autonome.wordpress.com/2009/10/02/firefox-startup-performance-weekly-summary-4/ 10/2/09]
[http://tinyurl.com/yjp8d6w Fixed startup bugs]
* [http://autonome.wordpress.com/2009/09/26/firefox-startup-performance-weekly-summary-3/ 9/26/09]
* [http://autonome.wordpress.com/2009/09/18/firefox-startup-performance-weekly-summary-2/ 9/18/09]
* [http://autonome.wordpress.com/2009/09/06/firefox-startup-performance-weekly-summary/ 9/6/09]
* [http://autonome.wordpress.com/2009/08/29/firefox-startup-performance-weekly-roundup/ 8/29/09]
* [http://autonome.wordpress.com/2009/08/22/weekly-firefox-startup-performance-roundup-2/ 8/22/09]
* [http://autonome.wordpress.com/2009/08/18/firefox-performance-the-dont-touch-the-damn-disk-edition/ 8/18/09]
* [http://autonome.wordpress.com/2009/08/08/firefox-startup-performance/ 8/8/09]


= References =
= References =
Line 183: Line 247:
#!/bin/sh
#!/bin/sh


FF=/tmp/firefox
FF=/Volumes/Fujitsu80Gb


mkdir $FF > /dev/null 2>&1
diskutil unmount force $FF
umount $FF > /dev/null 2>&1
diskutil mount /dev/disk1s2
mount_hfs /dev/disk1s2 $FF


$FF/Minefield$*.app/Contents/MacOS/firefox-bin -no-remote -foreground 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.
 
First, mount you external USB HD normally and use <code>df</code> to see what device is being used. Then eject the drive using <code>diskutil umount /Volumes/YourDrive</code> and you are set.
 
Do not eject the device using the Finder as that will not make it available at /dev/disk1s2 or wherever it was.


==Test Coverage==
==Test Coverage==

Latest revision as of 17:51, 20 July 2011

Overview

Description: Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices.

Project lead:
Project members: Taras Glek, Ben Hsieh, Steve Fink, Michael Wu, Shawn Wilsher

Bugs: Open | Fixed | Fixed in 3.6

Results: Performance Snapshot (snapshot numbers for last 7 days, and version comparisons)

Graphs: Windows XP | Windows Vista | Mac Leopard | Linux

Status: Weekly status updates

Active Projects

Estimated win Bug # Summary Owner Status Notes
~10% "Dirty Profile" Startup Reduction Constant startup relative to profile size Shawn Wilsher
significant bug 558200 Extension profiler platform api Steve Fink There is an easy way to provide feedback to extension developers to help them figure out why their extension is misbehaving. We need to implement that ASAP, so typical firefox installs(with lots of extensions) can be fast


Help Wanted/Onhold

Estimated win Bug # Summary Owner Status Notes
~8% bug 561842 Fold libraries into libxul Ted Mielczarek proof of concept done
up to 40% bug 531406 Optimize code locality in binaries. Working on enabling pgo atm. Taras Glek Linux almost done, need to figure out integration. Windows proof of concept needs work.

See blog post for more details. Taras and Ehsan working on Windows locality improvements (bug 553721).

~10% bug 512584 Fast paths for Cc/Ci Confirmed win. Unfortunately this approach touches a lot of sensitive code, might be easier to port js to not use Cc/Ci
TBD bug 513149 bug 553456 Speed up CSS parsing Zack Weinberg
significant bug 559663 Measuring IOPs Our current infrastructure does not measure cold startup effectively, it should.
TBD bug 569629 Get rid of static initializers These slowdown library loading, cause a lot of pagefaults on gcc platforms.


Other efforts:

Measurement & Testing Projects

  • cold startup testing

Future Projects

Inactive Projects

  • bug 507101 - combining js components
  • minification
  • Mine the Ts DTrace viz/logs (Drew)
    • Status: complete, moved on to filesystem operations below
    • Results
      • cold startup is heavily I/O-bound. 90% of cold startup time is spent in page faults and other I/O syscalls, especially read, getattrlist, and stat.
      • majority of time spent after Firefox actually gets up and running is in XBL and CSS.
  • Log and mine filesystem operations during startup (Ryan, Drew)
  • Find dead code with JSHydra (David Dahl)
    • Status: incomplete, needs tuning and file bugs on dead code found
    • bug 506128 - run jshydra to find js functions that have no callers
  • JSHydra continuous testing
    • possible test scenarios
      • ending semicolon bug (XXX)
      • dead code finder

Completed Projects

Fixed startup bugs

References

Meta bugs

Tips, Tools

  • comparing dynamic linking time between firefox and safari on mac
    • DYLD_PRINT_STATISTICS=YES /Applications/Firefox.app/Contents/MacOS/firefox-bin
    • DYLD_PRINT_STATISTICS=YES open -a Safari

Fastload

Measuring Ts

We've been using a method Vlad blogged about here. 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);'`

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.

Test Coverage

This is an index of Firefox startup scenarios which need automated test coverage.

TODO:

  • groups: chrome, content, extensions, labs, other?
  • mark which need no-chrome testing
test warm start cold start notes
empty profile yes yes
everything dirty bug 515540
min places yes yes informed by places-stats, bug 515540
med places yes yes ditto
max places yes yes ditto
med session informed by test pilot data
max session ditto
downloads
url-classifier data data is fully downloaded, should test page-load for a match and no match
form history
passwords
plugins
content preferences
extensions top 5?
extension update
application update
persona applied
weave
jetpack
ubiquity
page links are visited
page has microformats
page is ssl
page has plugin