Open Bug 1345334 Opened 7 years ago Updated 2 years ago

Store blocklist in indexeddb

Categories

(Toolkit :: Blocklist Implementation, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: kmag, Assigned: leplatrem)

References

Details

(Whiteboard: [MemShrink:P2], triaged)

Looking at the memory dominator tree in a fresh Firefox instance, the blocklist is one of the top items, at over 600K. We don't need to access it very often. At the points when we do, we should be able to load it from JSON and then discard it, or query an indexedDB database and close it, rather than keeping the whole thing in memory.
Whiteboard: [MemShrink]
Priority: -- → P2
Whiteboard: [MemShrink] → [MemShrink], triaged
Whiteboard: [MemShrink], triaged → [MemShrink:P2], triaged
Florian mentioned that he had someone that was interested in being mentored to fix this bug. We may want to adjust the summary a bit, from talking to Kris we agreed that the way to go here was to only compare the list of built-in addon IDs to the blocklist when either the blocklist or the addons db changed, which could all be done async after startup.

Per comment 0 it'd be nice if blocklist was in indexeddb so we didn't need to load the whole thing in memory, but even if we end up loading it all we can at least release it when we're done so I think that work could be split up.
Flags: needinfo?(florian)
(In reply to Robert Helmer [:rhelmer] from comment #1)
> we agreed that the way to go here was to only compare the list of built-in
> addon IDs to the blocklist when either the blocklist or the addons db
> changed, which could all be done async after startup.

To be clear, not just built-in add-on IDs, but all add-ons. And not just IDs.
We currently check all blocklistable props against all blocklist entries any
time someone accesses the blocklistStatus property of any add-on. Which
happens a lot.
As for storing in IndexedDB, it would be nice to store each blocklistable property as a separate index, so we can just query the DB for matching entries when we need to update blocklist status, and then I guess dump entries that need regexp matching in a separate store.
(In reply to Kris Maglione [:kmag] from comment #2)
> (In reply to Robert Helmer [:rhelmer] from comment #1)
> > we agreed that the way to go here was to only compare the list of built-in
> > addon IDs to the blocklist when either the blocklist or the addons db
> > changed, which could all be done async after startup.
> 
> To be clear, not just built-in add-on IDs, but all add-ons. And not just IDs.
> We currently check all blocklistable props against all blocklist entries any
> time someone accesses the blocklistStatus property of any add-on. Which
> happens a lot.

Right.. not sure why I wrote "built-in" there.
Assignee: nobody → mathieu
Summary: Don't store the blocklist in memory → Store blocklist in indexeddb
We have changed the goal of this bug enough that I don't think it goes on Mathieu's plate anymore, and from what I remember of our discussion, Kris said he could do it in less than an hour, so I guess he volunteered to take it?
Flags: needinfo?(florian)
Depends on: 1377539
Component: Add-ons Manager → Blocklist Implementation
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.