Firefox/Projects/Startup Time Improvements/StartupPatchUsage

From MozillaWiki
Jump to: navigation, search

Startup Patch

Quick Start

  • Download 2 patches from bug 480735
    • THESE MAY CHANGE, you may want to check the attachments on the bug before using the following patches, and the eventual goal after review is having these patches checked into trunk.
      • C++ Function Timer [1]
      • Instrumentation Patch [2]
      • I have marked the instrumentation patch as "latest", the latest C++ patch is in review by vlad for brenden and bsmedberg.
  • Before building you should update your mozconfig with the following option:
    • ac_add_options --enable-functiontimer
  • BUILD - please clobber your obj dir -
  • Add the following environment variables:
    • export NSPR_LOG_MODULES=functimer:5
    • export NSPR_LOG_FILE=/path/to/startup_log
  • Start Firefox
  • The logfile in /path/to/startup_log should have a bunch of timing information in it that looks like:
-1241130624[b5d18060]: > XRE_main
-1241130624[b5d18060]: -   115 ms (  115 ms total) - XRE_main [ScopedXPCOMStartup]
-1241130624[b5d18060]: > NS_CreateServicesFromCategory: xpcom-startup (xpcom-startup)
-1241130624[b5d18060]: <     0 ms (    0 ms total) - NS_CreateServicesFromCategory: xpcom-startup (xpcom-startup)
-1241130624[b5d18060]: -     4 ms (  119 ms total) - XRE_main [ScopedXPCOMStartup: Initialize]
-1241130624[b5d18060]: -     0 ms (  119 ms total) - XRE_main [ScopedXPCOMStartup: DoAutoreg]
-1241130624[b5d18060]: > NS_CreateServicesFromCategory: prefservice:after-app-defaults (prefservice:after-app-defaults)
-1241130624[b5d18060]: <     0 ms (    0 ms total) - NS_CreateServicesFromCategory: prefservice:after-app-defaults (prefservice:after-app-defaults)
-1241130624[b5d18060]: -     1 ms (  121 ms total) - XRE_main [Pref Service]
-1241130624[b5d18060]: > Init
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [Created thread]
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [UpdatePrefs]
-1241130624[b5d18060]: <     0 ms (    0 ms total) - Init
-1241130624[b5d18060]: -     0 ms (  121 ms total) - XRE_main [Socket Transport Service]
-1241130624[b5d18060]: -     0 ms (  121 ms total) - XRE_main [DNS Service]
-1241130624[b5d18060]: > Init
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [got SocketTransportService]
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [got DNS Service]
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [got Error Service]
-1241130624[b5d18060]: -     0 ms (    0 ms total) - Init [Registered observers]
-1241130624[b5d18060]: -     2 ms (    3 ms total) - Init [Set up network link service]
-1241130624[b5d18060]: <     0 ms (    3 ms total) - Init
-1241130624[b5d18060]: -     3 ms (  124 ms total) - XRE_main [IO Service]