The default bug view has changed. See this FAQ.

search engine "alias" getter caching is broken, results in many unnecessary synchronous SQLite reads when entering text in the location bar

RESOLVED FIXED in Firefox 10

Status

()

Firefox
Search
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Gavin, Assigned: Gavin)

Tracking

Trunk
Firefox 10
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

We iterate over all engines and retrieve their "alias" to compare to the entered text (for triggering search engines using a keyword). Unfortunately the getter for the alias doesn't cache a null result, which means that we end up hitting SQLite for the value multiple times in the common case (engines not having an alias).

(Jeff was seeing this hit the disk every time, which seems like a failure of caching for SQLite, since this DB is very small and should fit in memory. That's a separate issue that needs investigation though.)
Created attachment 568481 [details] [diff] [review]
patch
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #568481 - Flags: review?(rflint)
Attachment #568481 - Flags: review?(rflint) → review+
(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #0)
> (Jeff was seeing this hit the disk every time, which seems like a failure of
> caching for SQLite, since this DB is very small and should fit in memory.
> That's a separate issue that needs investigation though.)

It appears as though this was just rereading of the lock page, which is expected. I have however filed a bug on getting rid of that read too: bug 696364.
Created attachment 568698 [details] [diff] [review]
patch

I changed my mind about this after thinking about the "alias" getter - I think it's best to have aliases continue to be |null| if they're not set, rather than |""|. So to preserve that behavior I'm just switching to use "undefined" as the uninitialized value.
Attachment #568481 - Attachment is obsolete: true
Attachment #568698 - Flags: review?(rflint)
Attachment #568698 - Flags: review?(rflint) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/3cf9011b5494
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 10
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/3cf9011b5494
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.