Firefox/Projects/Startup Time Improvements: Difference between revisions
Jump to navigation
Jump to search
Joel Reymont (talk | contribs) No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
'''Description:''' Investigate areas for improving startup time of the Mozilla platform, find & fix issues that help Fennec and WinCE. | '''Description:''' Investigate areas for improving startup time of the Mozilla platform, find & fix issues that help Fennec and WinCE. | ||
;Bugs that affect startup are identified by "[ts]" in the whiteboard field. | |||
* [https://bugzilla.mozilla.org/buglist.cgi?quicksearch=sw%3A%5Bts%5D ts bugs]. | * [https://bugzilla.mozilla.org/buglist.cgi?quicksearch=sw%3A%5Bts%5D ts bugs]. | ||
= Instrumentation = | = Instrumentation = | ||
;Create an easily accessible timeline of the startup path (David, Vlad) | |||
* '''Status''': in progress | * '''Status''': in progress | ||
* '''Usage''': [https://wiki.mozilla.org/Firefox/Sprints/Startup_Time_Improvements/StartupPatchUsage#Quick_Start steps here] | * '''Usage''': [https://wiki.mozilla.org/Firefox/Sprints/Startup_Time_Improvements/StartupPatchUsage#Quick_Start steps here] | ||
| Line 32: | Line 20: | ||
** Example output: [http://people.mozilla.org/~dietrich/ddahl_sample_output.txt raw log] | ** Example output: [http://people.mozilla.org/~dietrich/ddahl_sample_output.txt raw log] | ||
;Mine the Ts DTrace viz/logs (Drew) | |||
* '''Status''': complete, moved on to filesystem operations below | * '''Status''': complete, moved on to filesystem operations below | ||
* '''Results''' | * '''Results''' | ||
| Line 41: | Line 29: | ||
** I think these two bugs aren't worth pursuing. As Gavin comments in them, the latency I noticed is due to unavoidable things like XBL attachment and flushing layout. Moreover, they contribute very, very little to startup time. | ** I think these two bugs aren't worth pursuing. As Gavin comments in them, the latency I noticed is due to unavoidable things like XBL attachment and flushing layout. Moreover, they contribute very, very little to startup time. | ||
;Log and mine filesystem operations during startup (Ryan, Drew) | |||
* '''Status''': in progress | * '''Status''': in progress | ||
* '''Todo''' | * '''Todo''' | ||
| Line 57: | Line 45: | ||
** [[Firefox/Projects/Startup_Time_Improvements/IO_Scratchpad]] | ** [[Firefox/Projects/Startup_Time_Improvements/IO_Scratchpad]] | ||
= | = Current Activity = | ||
;Find dead code with JSHydra (David Dahl) | |||
* '''Status''': in progress | * '''Status''': in progress | ||
* '''Todo''' | * '''Todo''' | ||
| Line 68: | Line 56: | ||
= Testing = | = Testing = | ||
;Dirty profile testing (Alice, David Dahl, Dietrich) | |||
* '''Status''': | * '''Status''': partially complete | ||
* '''Todo''' | * '''Todo''' | ||
** Create various scenarios to measure | ** Create various scenarios to measure | ||
| Line 76: | Line 64: | ||
** Roll-up reporting of results | ** Roll-up reporting of results | ||
* '''Results''' | * '''Results''' | ||
** Builds marked "dirty" on the [http://tinderbox.mozilla.org/showbuilds.cgi?tree= | ** Builds marked "dirty" on the [http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox tree] | ||
;Cold Startup Measurement (Alice, Drew) | |||
* '''Status''': in progress | |||
* '''Todo''' | |||
** Talos patches for head/tail script support | |||
** Talos head/tail scripts for cold startup for all platforms | |||
*** disable fastload, OS-specific calls | |||
** deploy to test tree | |||
** deploy to mozilla-central | |||
* '''Done''' | |||
** determine simulated cold startup methods for all platforms | |||
* '''Results''' | |||
;JSHydra continuous testing | |||
* '''Status''': not started | * '''Status''': not started | ||
* '''Todo''' | * '''Todo''' | ||
| Line 86: | Line 86: | ||
*** dead code finder | *** dead code finder | ||
= | = Needs Action = | ||
Notes, other ideas to develop further, bugs to file, etc. | Notes, other ideas to develop further, bugs to file, etc. | ||
| Line 111: | Line 111: | ||
* sql query count measurement (find my bug for this) | * sql query count measurement (find my bug for this) | ||
Needs investigation: | |||
* | * .order files (webkit) | ||
* | * [https://bugzilla.mozilla.org/show_bug.cgi?id=279839#c29 string pool for jsxpcom] | ||
= References = | = 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 | * Vlad's blog posts | ||
Revision as of 16:53, 25 August 2009
Overview
Sprint lead: Dietrich Ayala
Sprinters: Ryan Flint, Drew Willcoxon, David Dahl
Concurrent work: Vlad Vukićević, Taras Glek
Description: Investigate areas for improving startup time of the Mozilla platform, find & fix issues that help Fennec and WinCE.
- Bugs that affect startup are identified by "[ts]" in the whiteboard field.
Instrumentation
- Create an easily accessible timeline of the startup path (David, Vlad)
- Status: in progress
- Usage: steps here
- Results
- bug 480735 instrumentation
- bug 503605 visualization
- Example output: Simile timeline
- Example output: raw log
- Mine the Ts DTrace viz/logs (Drew)
- Status: complete, moved on to filesystem operations below
- Results
- It's my conclusion that (cold) startup is heavily I/O-bound. Something like 90% of cold startup time is spent in page faults and other I/O syscalls, especially read, getattrlist, and stat. And the majority of time spent after Firefox actually gets up and running is in XBL and CSS. Any improvements that ignore these observations will therefore be marginal IMO.
- Bugs
- bug 504858 - Investigate delaying initialization of bookmarks toolbar
- bug 504872 - Investigate further delaying initialization of the search bar
- I think these two bugs aren't worth pursuing. As Gavin comments in them, the latency I noticed is due to unavoidable things like XBL attachment and flushing layout. Moreover, they contribute very, very little to startup time.
- Log and mine filesystem operations during startup (Ryan, Drew)
- Status: in progress
- Todo
- maybe write a new dtrace script for targeting 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
- investigating dtrace timing/FS cache issues on OS X
- Drew's notes
- Joel's notes
- checking out Xperf and others for Windows work
- References
- Josh Aas's post
- Taras' post on using GDB for logging
- Firefox/Projects/Startup_Time_Improvements/IO_Scratchpad
Current Activity
- Find dead code with JSHydra (David Dahl)
- Status: in progress
- Todo
- Results
- Bugs
- bug 506128 - run jshydra to find js functions that have no callers
Testing
- Dirty profile testing (Alice, David Dahl, Dietrich)
- Status: partially complete
- Todo
- Create various scenarios to measure
- sessions, downloads, cookies, urlclassifier data
- Fix date updater for med/large profiles
- Roll-up reporting of results
- Create various scenarios to measure
- Results
- Builds marked "dirty" on the tree
- Cold Startup Measurement (Alice, Drew)
- Status: in progress
- Todo
- Talos patches for head/tail script support
- Talos head/tail scripts for cold startup for all platforms
- disable fastload, OS-specific calls
- deploy to test tree
- deploy to mozilla-central
- Done
- determine simulated cold startup methods for all platforms
- Results
- JSHydra continuous testing
- Status: not started
- Todo
- Feasibility analysis: need to find out if even possible
- Determine test scenarios
- ending semicolon bug (XXX)
- dead code finder
Needs Action
Notes, other ideas to develop further, bugs to file, etc.
TODO:
- enumerate findings, convert to best practices recommendation
- 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?
Bugs:
- FILEME - minification packaging step
- bug 507101 - component combining packaging step
- bug 509755 - modules into jar file packaging step
- FILEME - micro-benchmark tests
- see also the mochitests i wrote for this (find the places bug for this)
- FILEME - dirty test (or micro?): need test for opening the 80th tab for example
- FILEME - tracing/trace-ability reporting
- traceviz (bug 497999)
- FILEME - other dirty profiles
- sessions, downloads, urlclassifier data, post-crash session
- sql query count measurement (find my bug for this)
Needs investigation:
- .order files (webkit)
- string pool for jsxpcom
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
- Taras' Fennec Startup Work
- bug 459117 "make fennec faster", mostly startup bugs
- startup log
- bug 470116 various timing scripts
Tips, Tools
- 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)
- 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
Fastload
- why does js_Execute take so long for fastloaded components?
- what is fastload?
- fastload pref docs
Measuring Ts
- startup-unix.pl in mozilla/tools/performance/startup
- edit it to use this HTML in place of startup-test.html:
<html>
<body onload="
var now = (new Date()).getTime();
var begin = document.location.search.split('=')[1]; // ?begin=nnnnn
dump((now - begin) + '\n');
window.close();
">
</body>
</html>
- set
dom.allow_scripts_to_close_windowsandbrowser.dom.window.dump.enabledto true in your testing profile - run it in a loop to collect more stable results:
- set
#!/bin/bash cd ~/moz/trunk/mozilla/tools/performance/startup for ((i=0; i < 5; i++)) do perl startup-unix.pl ~/moz/trunk/build-dbg/dist/MinefieldDebug.app/Contents/MacOS/firefox-bin -P startup >> results.txt; done;