Places:Performance

From MozillaWiki
Jump to: navigation, search

Our history implementation can have a non-trivial impact on the browser's performance, not only when actively browsing history or bookmarks, but also in other areas such as (for example) page load, or browser startup / shutdown.

Known Problem Areas

From previous experience, the most-affected areas are outlined below. Special care should be taken to ensure there are no unacceptable regressions in them. However, there may be other performance implications that we do not yet know or anticipate (ideas, anyone?). Please update this page as new information (or new doubts/questions) come up.

Page Load

In the case of page load, one reason for the performance hit is that links must be colored as visited / not visited when displaying a page, which requires going through history (see Bug #329816).

Browser Startup

Brett Wilson's experience here is that places somewhat regresses startup speed when there's no history, but significantly improves it when there is large history.

Browser Shutdown

Browser shutdown can be negatively impacted because expiring history is (or used to be) slow.

Bookmarks/History UI

The "Clear history" button can be slow.

Testing Environments

We must run tests on different environments:

  • On Firefox 2.
  • On Minefield without Places (the current default).
  • On Minefield with Places (with --enable-places).

We also need to run tests with these permutations:

  • With little or no history data.
  • With a medium or average-sized history file.
  • With a large amount of history data.

For certain tests, such as pageload, we also want to test with history data which matches few/some/all links in the pageset, and of which the links of the pageset represent a small/large percentage of the history data itself.

Obviously, there are a lot of permutations of the above :-) So the following could be reduced (suggestions welcome here):

  • Limit the tests on Firefox 2 to only a few test environments. e.g., only with medium-sized history data which matches some links of the page set.
  • Create "no history", "medium history", and "large history" versions of the pageload test, and possibly startup as well. No need to run all the tests on each permutation.
  • Run several tests manually, and if there is no significant difference between them, just leave it at that. Possibly we could drop the different "percentage of matching links" veriations, or at least the "percentage of links vs history db size" ones.
  • We could drop any of the above if there is strong agreement within the team that it would not be needed.

Test Data

Page Load

Brett Wilson spent a good chunk of time optimizing Places. This bug has some test data: Bug #329816. Note that he times the IsVisited call directly, as the page load tests have too much noise to be useful.

Dan Mills did some preliminary pageload tests on a limited set of environments and came up with these results:

On Firefox 2 w/ my medium-sized history file (baseline): 249.829

On Minefield:

  • No places, medium history: 236.951
  • With places, medium history: 233.097
  • No places, small history: 228.829
  • With places, small history: 237.829

There are two caveats with the above tests, though:

  • The pageset had a very small (~0) percentage of visited links.
  • There is no large history file yet, so there's no data for that case.

Comments welcome.

Startup

TBD

Shutdown

TBD

Other

TBD