Firefox Startup Performance Weekly Summary

Recent activity:

  • An improvement in startup time on Mac Leopard of around ~16% (aka: Very Large) was found by Joel Reymont and fixed by Masayuki Nakano in bug 517549. Mac users rejoice!
  • The Windows cold startup regression from 3.5 to 3.6 being tracked in bug 517741. Help finding the window for this would be awesome.
  • JAR Performance: Alfred Kayser has a new patch on bug 510844 which should increase throughput of JAR file reading, about ready to land.
  • Ben Hsieh is making progress removing the needless stats of already-fastloaded components and other stat removals in bug 511761.
  • Service caching work is still in progress in bug 516085. Drew’s tests showed no significant win on Tp, but the patch did reduce IO service retrievals by 58%. It might be worth pushing this to the Places branch to get a better idea of the total performance impact of the change.
  • Ryan Flint landed bug 499123, combining a bunch of about: pages into a single component, on 1.9.2 branch for Firefox 3.6.
  • Bookmarks toolbar: I put a patch on bug 504858 that pushes back the population of the toolbar until after the browser window comes up. Checking into the Places branch showed a 1.5% improvement to warm startup on Windows. Just waiting on review.
  • CSS Parsing Time: Zack is working on major CSS parser changes in bug 513149.

Projects in a holding pattern:

  • Preference Files: Taras Glek has been working on combining the different preference files into a single one at build time, in bug 507288. The patch is there, and is just trying to find a way to land cleanly.
  • Cold Startup Testing: Drew and Alice made a bunch of progress on bug 510587, to create a new Ts that measures cold startup. Alice is working on mobile Talos though, so this is sidelined for a bit. The only issue left is reliable Windows measurement, but we’re not going to block on it, can live with Mac and Linux to start off.
  • JARification: David abandoned moving JS modules into a JAR file, since those files are fastloaded. However, since we want things like post-extension-install restarts to be fast, and those cause fastload cache invalidation, we might want to do things like this anyways. I filed a bug for the same treatment for components. These are lower priority, since they’re not the normal startup case. Follow along with all JAR-ification via the tracker bug.
  • Startup Timeline: No updates, still not landed. Add [ft] in the whiteboard of your bug w/ the function names you want timed and David will generate it and update the bug.
  • PGO for Places, mozStorage and SQLite: Still blocking on Rel-Eng fixing bug 486783, which now has patches!
  • Static Analysis: No progress on bug 506128. David needs to file a bug with the final log of named-yet-uncalled functions.
  • Dirty Profile Testing: No progress. Need to list scenarios, file bugs for each, generate Talos config patches and profile data, and then move it into Rel-Eng territory. Also, need to get a separate Tinderbox tree, since it’s going to cause a bazillion new columns.
  • Joel Reymont noted in bug 513076 that there are serious drawbacks to getting our libraries in the dyld shared cache on Mac, so has deprioritized that work.

Firefox Startup Performance Weekly Summary

Apologies for not posting last week, but I was on vacation. Recent activity:

  • I’ve updated the project wiki page with a table of summarized numbers for at-a-glance tracking of progress. I need to disable superfetch and try again on Windows.
  • Our measurements of cold startup showed a huge regression on Windows from 3.5 to 3.6. Tracking this in bug 517741.
  • JARification: David abandoned moving JS modules into a JAR file, since those files are fastloaded. However, since we want things like post-extension-install restarts to be fast, and those cause fastload cache invalidation, we might want to do things like this anyways. I filed a bug for the same treatment for components. These are lower priority, since they’re not the normal startup case. Follow along with all JAR-ification via the tracker bug.
  • JAR Performance: I’m going to test-land bug 510844 on the Places branch to figure out what’s going wrong on the tinderbox. It should increase throughput of JAR file reading, possibly affecting Ts and Tp.
  • Removing the needless stats of already-fastloaded components is being looked at more broadly in bug 511761 by Ben Hsieh with help from Taras and others. There are a bunch of dirty ways to trigger component re-registration and fastload cache invalidation, so I filed bug 517515 to consolidate these in an explicit manner.
  • Cold Startup Testing: Drew and Alice made a bunch of progress on bug 510587, to create a new Ts that measures cold startup. Alice is working on mobile Talos though, so this is sidelined for a bit. The only issue left is reliable Windows measurement, but we’re not going to block on it, can live with Mac and Linux to start off.
  • Preference Files: Taras Glek has been working on combining the different preference files into a single one at build time, in bug 507288. The patch is there, and is just trying to find a way to land cleanly.
  • Service Caching: Vlad, Drew and Taras are working on caching some services globally for C++ code. For example, 50% of the GetService calls for the IO service originate from NS_NewURI usage. This work is in bug 516085.

Projects in a holding pattern:

  • Startup Timeline: No updates, still not landed. Add [ft] in the whiteboard of your bug w/ the function names you want timed and David will generate it and update the bug.
  • PGO for Places, mozStorage and SQLite: Still blocking on Rel-Eng fixing bug 486783, which now has patches!
  • Static Analysis: No progress on bug 506128. David needs to file a bug with the final log of named-yet-uncalled functions.
  • Dirty Profile Testing: No progress. Need to list scenarios, file bugs for each, generate Talos config patches and profile data, and then move it into Rel-Eng territory. Also, need to get a separate Tinderbox tree, since it’s going to cause a bazillion new columns.
  • Joel Reymont noted in bug 513076 that there are serious drawbacks to getting our libraries in the dyld shared cache on Mac, so has deprioritized that work.
  • Ryan Flint blogged about various front-end improvements he’s working on that affect startup time.
  • CSS Parsing Time: Zack says his work in bug 513149 might improve CSS parsing time by 50%, and it’s next on his list.

Firefox Startup Performance Weekly Summary

Let’s start with the numbers. Vlad spent some time measuring warm startup on the Mac, and it looks very nice: Firefox 3.6 starts up about 10% faster than 3.5, and 3.7 starts up about 20% faster than 3.5. I measured both cold and warm startup on Windows 7, and the picture is not so rosy there. Warm startup is basically flat across 3.5, 3.6 and 3.7, in my tests. Cold startup is… well, weird. Allow me to explain…

My cold startup methodology is simple: On a basically clean install of Windows 7, I’d create a new profile, start the browser up, close it and then reboot. Then I’d measure Firefox startup time after the OS settled. Then I’d do that reboot-and-measure step a bunch more times. Yes, so much fun. I measured Firefox startup time using the method Vlad posted to his blog. This doesn’t do anything to avoid OS optimizations that might persist across reboots, which is a potential flaw, as you’ll see below.

Firefox 3, 3.6 and 3.7 all had consistent numbers across their runs. However, Firefox 3.5 displayed a unique behavior: The first two cold starts were appropriately slow, similar to the cold startup times of the other versions. The subsequent runs were *very* fast for a cold start! I rebooted a few times, and started other versions a few times, then tried a series of 3.5 runs again… and saw the same thing: the first two runs were in the ballpark of other Firefox versions, but subsequent runs were crazy fast. Vlad was talking earlier in the week about a predictive optimization feature that Windows has, learning from an application’s behavior to optimize it’s performance. Possibly that feature works fantastically with Firefox 3.5, and for whatever reason does not work nearly as well with previous or subsequent versions of the app? I’ve clearly crossed into the realm of fantasy here, so alternate theories are welcome. Perhaps I should round-robin through all versions instead of doing serial runs of the same version.

Firefox 3.5 aside, when measuring cold startup I also see the regression that Drew blogged about. We’ll get a bug filed and help from QA to get a regression range for this.

Status updates:

  • Startup Timeline: Still not landed, and David found that the timeline instrumentation if put in certain places causes major stability issues. As before, he can provide timeline info for you, just point him at the code by putting [ft] in the whiteboard of your bug.
  • PGO for Places, mozStorage and SQLite: Still blocking on Rel-Eng fixing bug 486783. I still need to connect with John O’Duinn and see if we can move this up in the schedule.
  • JARification: David started working on moving JS modules into a JAR file. Follow along with all JAR-ification via the tracker bug. Alfred Kayser is working on getting bug 510844 landed, which should increase throughput of JAR file reading.
  • JS Component Combining: Further effort is probably not worth it, since these components are fastloaded. Removing the needless file stats when these are first instantiated is what we need to do. I need to talk to Damon and find a XPConnect/Component-loader person for this.
  • Static Analysis: No progress on Bug 506128. David needs to file a bug with the final log of named-yet-uncalled functions.
  • Dirty Profile Testing: No progress. Need to list scenarios, file bugs for each, generate Talos config patches and profile data, and then move it into Rel-Eng territory. Also, need to get a separate Tinderbox tree, since it’s going to cause a bazillion new columns.
  • Cold Startup Testing: Drew and Alice made a bunch of progress on bug 510587, to create a new Ts that measures cold startup. They’re starting with Mac and Linux, and will tackle Windows later. Drew blogged about their work on this.
  • Joel Reymont noted in bug 513076 that there are serious drawbacks to getting our libraries in the dyld shared cache on Mac, so is deprioritizing that work for now.
  • Ryan Flint blogged about various front-end improvements he’s working on that affect startup time.
  • CSS Parsing Time: Zack says his work in bug 513149 might improve CSS parsing time by 50%, and it’s next on his list.