Firefox/Projects/Startup Time Improvements: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
'''Description:''' Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices.
'''Description:''' Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices.


'''Project lead:''' Dietrich Ayala <br/>
'''Project lead:''' <br/>
'''Project members:''' Ryan Flint, Drew Willcoxon, David Dahl, Vlad Vukićević, Taras Glek, Joel Reymont, Ben Hsieh, Rob Strong, Zack Weinberg
'''Project members:''' Taras Glek, Ben Hsieh, Steve Fink


'''Bugs:''' [http://tinyurl.com/ygbnzmd Open] | [http://tinyurl.com/yjp8d6w Fixed] | [http://bit.ly/5t9fA9 Fixed in 3.6]
'''Bugs:''' [http://tinyurl.com/ygbnzmd Open] | [http://tinyurl.com/yjp8d6w Fixed] | [http://bit.ly/5t9fA9 Fixed in 3.6]
Line 17: Line 17:
=Active Projects=
=Active Projects=
<onlyinclude>
<onlyinclude>
{|border="1" cellspacing="0" cellpadding="2"
!Estimated win
!Bug #
!Summary
!Owner
!Status
!Notes
|-
|~10%
|{{bug|520309}}
|Startup cache
|Ben Hsieh
|
|Patch nearly ready for review, working on making tests build and improving post-startup writes. Clients in working state.
|-
|massive
|{{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
|-
|massive
|{{bug|559663}}
|Measuring IOPs
|
|
|Our current infrastructure does not measure cold startup effectively, it should.
|}
</onlyinclude>
=Help Wanted=
{|border="1" cellspacing="0" cellpadding="2"
{|border="1" cellspacing="0" cellpadding="2"
!Estimated win
!Estimated win
Line 26: Line 58:
|-
|-
|~8%
|~8%
|{{bug|525013}}
|{{bug|561842}}
|Static build configuration
|Fold libraries into libxul
|Ted Mielczarek
|Ted Mielczarek
|
|
|Ted's got a new baby! Patch still needing Bsmedberg review.
|proof of concept done
|-
|-
|~40%
|up to 40%
|{{bug|531406}} {{bug|418866}}
|{{bug|531406}} {{bug|418866}}
|Optimize code locality in binaries. Working on enabling pgo atm.
|Optimize code locality in binaries. Working on enabling pgo atm.
|Taras Glek
|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}}).
|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|520309}}
|Startup cache
|Ben Hsieh
|
|Patch nearly ready for review, working on making tests build and improving post-startup writes. Clients in working state.
|-
|-
|~10%
|~10%
Line 51: Line 76:
|
|
|
|
|Confirmed win. onhold.
|Confirmed win. Unfortunately this approach touches a lot of sensitive code, might be easier to port js to not use Cc/Ci
|-
|-
|TBD
|TBD
|{{bug|513149}}
|{{bug|513149}} {{bug|553456}}
|Speed up CSS parsing
|Speed up CSS parsing
|Zack Weinberg
|Zack Weinberg
|
|Current top priority is nsCSSDeclaration/DataBlock rewrite, {{bug|553456}} - on track for review-readiness by end of week
|-
|TBD
|{{bug|528884}}
|DOM flattening and XBL removal
|Asaf Romano
|
|First project is converting Places menu and toolbar bindings to straight XUL. See also [https://wiki.mozilla.org/Mobile/XULOptimization Mobile's work in this area].
|-
|TBD
|{{bug|550011}}
|extension xpt files cause all to be re-read
|
|
|
|
|
|-
|massive
|{{bug|558200}}
|Extension profiler platform api
|
|
| 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
|-
|-
|massive
|massive
Line 88: Line 92:
|Our current infrastructure does not measure cold startup effectively, it should.  
|Our current infrastructure does not measure cold startup effectively, it should.  
|}
|}
</onlyinclude>
 


Other efforts:
Other efforts:

Revision as of 18:34, 18 August 2010

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

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% bug 520309 Startup cache Ben Hsieh Patch nearly ready for review, working on making tests build and improving post-startup writes. Clients in working state.
massive 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
massive bug 559663 Measuring IOPs Our current infrastructure does not measure cold startup effectively, it should.


Help Wanted

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 bug 418866 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
massive bug 559663 Measuring IOPs Our current infrastructure does not measure cold startup effectively, it should.


Other efforts:

  • bug 545191 Investigate Tp/Ts instability, Zack Weinberg
    • Waiting for releng to prep a Talos slave box for experiments.
  • bug 514083 HFS+ compression on Mac OSX 10.6
  • bug 533038 Investigate how to reduce the number of files used for extensions

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