Closed Bug 1773996 Opened 2 years ago Closed 2 years ago

[CTW] Don't queue cache updates if we're never going to send them

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

  1. We currently call QueueCacheUpdate in quite a few places, regardless of whether the cache is enabled or we're in a content process.
  2. QueueCacheUpdate then unconditionally tweaks the hash table, again regardless of these conditions.
  3. We only call ProcessQueuedCacheUpdates if the cache is enabled and we're in a content process.

The result is that when the cache is disabled and/or in parent process documents, we will have a bunch of stuff sitting in mQueuedCacheUpdates forever. It will just keep growing until the document is destroyed.

Rather than having conditions everywhere even for simple cases, I think QueueCacheUpdate should just return early if the cache isn't relevant.

Assignee: nobody → jteh

This was wasting memory for the parent process, and when the cache was disabled, all content processes.
QueueCacheUpdate now checks whether we are actually sending cache updates before it queues anything.
Simple calls rely on this check, rather than guarding the call to QueueCacheUpdate themselves.
We still call QueueCacheUpdate conditionally for more complex cases which would have to do work before calling QueueCacheUpdate, since we don't want to pointlessly do that prerequisite work.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/59af8eea2123
Don't queue a11y cache updates if we're never going to send them. r=morgan
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: