Open Bug 1652483 Opened 5 years ago Updated 5 years ago

Fire the heuristic timer early if UnifiedComplete decides it won't be showing a heuristic result

Categories

(Firefox :: Address Bar, enhancement, P3)

enhancement
Points:
3

Tracking

()

People

(Reporter: bugzilla, Unassigned)

References

Details

Bug 1645521 introduced a timer for heuristic results to reduce flickering as multiple heuristic results are delivered to the providers manager. Since UrlbarProviderUnifiedComplete is type HEURISTIC, it triggers the heuristic timer. But since UrlbarProviderHeuristicFallback, UrlbarProviderTokenAliases, UrlbarProviderOmnibox, and UrlbarProviderAutofill all provide heuristic results, UrlbarProviderUnifiedComplete is no longer guaranteed to return a heuristic result.

We should add a way for an active heuristic provider to declare it won't be providing a heuristic result and to remove itself from queryContext.pendingHeuristicProviders. That way we can fire the heuristic timer early. This is particularly relevant for UnifiedComplete, since it blocks the heuristic timer on a Places DB lookup in most cases. We'd likely see an improvement in the time-to-first-result of a few milliseconds.

I'll harp on my provider.startHeuristicQuery idea again... :-)

Severity: -- → S3

Yeah, that might be the way to do this. That's described in bug 1645324 comment 2. How would it handle the case where startQuery returns a result before startHeuristicQuery, even after the timeout? startHeuristicQuery could be slow given DB lookups. Do we hold all results back until we have at least one heuristic result?

There would be another step in the query process. Currently we have isActive -> startQuery, so it would be isActive -> startHeuristicQuery -> startQuery. The startHeuristicQuery step would happen only for heuristic providers. Just as all isActive calls must finish before the startQuery step starts, we'd wait for all startHeuristicQuery calls to finish before starting the startQuery step. If a heuristic provider doesn't have a result for the current query, then it would just return from startHeuristicQuery without having added a result.

You need to log in before you can comment on or make changes to this bug.