Closed Bug 979121 Opened 10 years ago Closed 3 years ago

Re-filter URL bar search results in-memory

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: rnewman, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [Power:P2])

When you type in the URL bar, BrowserSearch#filter is called when the text changes. It restarts the SearchLoader, which calls BrowserDB#filter, which builds and runs a query.

Consider that much of the time the new string will be an extension of the previous string.

As such, in many cases we can actually filter down the *previous* set of results in memory, without hitting the DB again. The results are guaranteed to be in the same frecency order; the only time we'd get different results is if the first query exceeded SEARCH_LIMIT (currently 100).

It's possible that SQLite will do an adequate job of this on its own, but we build a big string query, which has to be parsed, so I doubt it.

The consequences of this DB query on each character are clearly visible in power usage traces:

http://people.mozilla.org/~mfinkle/fennec/power/nexuss-power-opentype-url-nosuggestions-fennec.png

so let's explore some simple in-memory optimizations.
Assignee: rnewman → nobody
Status: ASSIGNED → NEW
Whiteboard: [Power]
Whiteboard: [Power] → [Power:P2]
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.