Firefox/Projects/Startup Time Improvements: Difference between revisions
No edit summary |
|||
| Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
'''Description:''' Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices. | |||
'''Project lead:''' Dietrich Ayala <br/> | '''Project lead:''' Dietrich Ayala <br/> | ||
'''Project members:''' Ryan Flint, Drew Willcoxon, David Dahl, Vlad Vukićević, Taras Glek, Joel Reymont, Ben Hsieh | '''Project members:''' Ryan Flint, Drew Willcoxon, David Dahl, Vlad Vukićević, Taras Glek, Joel Reymont, Ben Hsieh, Rob Strong | ||
'''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] | ||
'''Results''' | '''Results''': [http://people.mozilla.org/~dietrich/snapshot/ Performance Snapshot] (snapshot numbers for last 7 days, and version comparisons) | ||
'''Performance graphs:''' [http://bit.ly/5fjmP9 Windows XP] | [http://bit.ly/8FjKvj Windows Vista] | [http://bit.ly/7aHx3r Mac Leopard] | [http://bit.ly/8wUHGs Linux] | |||
[http://autonome.wordpress.com/tag/startup/ Weekly status updates] | '''Status:''' [http://autonome.wordpress.com/tag/startup/ Weekly status updates] | ||
=Active Projects= | =Active Projects= | ||
Revision as of 22:02, 8 February 2010
Overview
Description: Improve startup time of Firefox and Fennec on all operating systems and platforms, including mobile devices.
Project lead: Dietrich Ayala
Project members: Ryan Flint, Drew Willcoxon, David Dahl, Vlad Vukićević, Taras Glek, Joel Reymont, Ben Hsieh, Rob Strong
Bugs: Open | Fixed | Fixed in 3.6
Results: Performance Snapshot (snapshot numbers for last 7 days, and version comparisons)
Performance graphs: Windows XP | Windows Vista | Mac Leopard | Linux
Status: Weekly status updates
Active Projects
Development
- bug 512584 - fastpath Components.*
- bug 525013 - Static build
- bug 514083 - HFS+ compression on Snow Leopard
- bug 520309 - new startup cache
- bug 503483 - faststart component
- bug 513149 - speed up CSS parsing
- DOM flattening and XBL removal in Firefox
Measurement & Testing
- cold startup testing
- bug 532965 - fix Mac cold startup test
- bug 522807 - windows
- dirty profile testing
- bug 515540 - dirty+cold startup
- 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 - string pool for jsxpcom
- taking advantage of tracing
- figure out where we're not tracing in the startup log
- dmandelin's blog post
- traceviz (bug 497999)
- timeline of the startup path (David, Vlad)
- Status: incomplete (held up on hangs, nspr changes)
- docs
- bug 480735 instrumentation
- bug 503605 visualization (Simile timeline, raw log)
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)
- 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)
- Status: complete, bugs filed for egregious offenders
- Results
- checking out Xperf and others for Windows work
- investigating dtrace timing/FS cache issues on OS X
- Instruments appears to have the same issues
- Simple JS file exec script has yielded some results
- References
- 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
- possible test scenarios
Completed Projects
References
- Meta bugs
- bug 459117 Fennec performance meta bug
- bug 447581 Startup meta bug
- bug 479078 Startup research meta bug
- bug 7251 very old startup meta bug
- Vlad's blog posts
- Taras' Fennec Startup Work
- bug 459117 "make fennec faster", mostly startup bugs
- startup log
- bug 470116 various timing scripts
Tips, Tools
- Cold startup
- Flushing Windows' disk cache
- Flushing Mac OS X's disk cache
- Firefox/Projects/Startup_Time_Improvements_Notes: Vlad's emails about cold startup, including Linux (maybe move this info to this page)
- Windows Prefetch/Superfetch
- XP Prefetch wiki
- Vista/Win7 SuperFetch wiki
- useful Pre/SuperFetch overview
- Presentation slides on the guts of Pref/SuperFetch by military forensic analyst
- Prefetch
- Profile for each application: List of DLLs used, Run count, Time stamps
- Prefetch files stored in %SystemRoot%\Prefetch: .pf extension, Up to 128 are kept
- Can tell if same app run from multiple locations
- SuperFetch
- turn off: net stop sysmain
- AG*.db files, contain "scenarios" for preloading
- Prefetch
- Technet article on Vista mem mgmnt
- registry keys for toggling SuperFetch
- DTrace
- nuts and bolts how-to for getting dtrace running with mozilla
- project overview of integrating dtrace with mozilla
- dtrace community page, lots of links
- dtrace homepage? not as useful as previous link
- intro from dtrace guidebook, really useful but not mozilla/js-specific
- brief descriptions of the javascript* probes
- David Mandelin's notes on tracing C++ code
- 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
- why does js_Execute take so long for fastloaded components?
- what is fastload?
- fastload pref docs
Measuring Ts
We've been using a method Vlad blogged about here. The steps are below.
- save this html file somewhere locally
- 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:
./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 |