Closed Bug 609603 Opened 14 years ago Closed 14 years ago

Search providers in the awesomescreen results are slow to update

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(fennec2.0+)

VERIFIED FIXED
Tracking Status
fennec 2.0+ ---

People

(Reporter: mbrubeck, Assigned: wesj)

Details

(Keywords: polish)

Attachments

(1 file, 2 obsolete files)

Steps to reproduce:
1) Open the awesomescreen and type something with no matches (like "hghghghg").
2) Wait for the search providers to show up.
3) Type another letter (so the new query is e.g. "hghghghga").

Each time you type a new letter, it takes up to 2-3 seconds for the search provider rows to update.  The delay might depend on your profile size; I tested this on Android with a fully-synced profile (around 13MB of data).

Based on logging, all of the delay is spent waiting for PACS.startSearch to finish returning results.

Maybe we can improve this by assuming that if the old query returned zero results *and* is a prefix of the new query, then the new query will return zero results too.
tracking-fennec: --- → ?
Attached patch Patch v1 (obsolete) — Splinter Review
This implements what is mentioned in comment 1, and cleans up a few other things. We compare the current query to the previous query. If they match except for characters at the end, and if the number of results in the previous query equals the number of search engines we have, we just reuse the previous query (PACS should be doing something like this anyway?).

I wasn't seeing the slowness on device Matt, but my profile is smaller than the one you are using. I'll try to reproduce and see if this helps, but if you want to apply the patch and try too, would be appreciated.
Comment on attachment 488228 [details] [diff] [review]
Patch v1

Yep, this fixes the slowness for me.  There's still a delay before the search engines first appear (while the PACS is still looking for matches), but afterwards they update quickly as I type.  (There's still a delay when I backspace, but that's expected and would take more work to fix.)

But when I actually tap on the awesomescreen row, it searches for the first query that I typed (without any additional characters I typed after the results appeared).

One other note:

>diff --git a/components/AutoCompleteCache.js b/components/AutoCompleteCache.js
>+      let prevRegEx = new RegExp("^" + prev.searchString);
>+      if (prev.matchCount == this.searchEngines.length && query.match(prevRegEx)) {

Building a regexp like this will not work right if the searchString contains special characters like [*+?].  I would use "query.indexOf(prev.searchString) == 0" instead.
Attached patch Patch v2 (obsolete) — Splinter Review
Thanks for catching that Matt. I want to stare at this for a bit longer, but here's a revised patch that WFM.

We have to regenerate this list of search provider results in order to update the attached urls. To fix it, I moved all of object used for cachedResults into a new object too...
Attachment #488228 - Attachment is obsolete: true
I don't see this and I don't to add code for something that is not a real problem.

Reopen if we see the slowdown
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
I made a video using today's nightly build: http://vimeo.com/16706473

Sorry for the blurrycam and background noise, but I think you can get the idea.  Basically, this feature is not usable at all after I've synced my normal profile.
Another approach would be to always add have the search providers in the list, not added every time, but semi-permanent. If the search engines change in any way, we get notified and could update the semi-fixed rows.
The autocomplete controller handles both keypresses, and clicks in the list. Adding richlistitems with adding them to the result set will lead to unpredictable results.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
tracking-fennec: ? → 2.0-
Keywords: polish
I am having second thoughts about 2.0-, so I am marking it 2.0+
tracking-fennec: 2.0- → 2.0+
Assignee: nobody → wjohnston
Attached patch Patch v_Splinter Review
Not changed to much, but works fine here.
Attachment #488342 - Attachment is obsolete: true
Attachment #496653 - Flags: review?(mark.finkle)
Attachment #496653 - Flags: review?(mark.finkle) → review+
Whiteboard: [fennec-checkin-postb3]
Wes - I don't think we landed this yet
Actually, we did:
http://hg.mozilla.org/mobile-browser/rev/c6499027bb47
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Whiteboard: [fennec-checkin-postb3]
verified FIXED On build:
Mozilla/5.0 (Android; Linux armv71; rv:2.0b9pre) Gecko/20100104 Namoroka/4.0b9pre Fennec/4.0b4pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: