Closed Bug 1800181 Opened 2 years ago Closed 2 years ago

[CTW] Atomize more value strings to reduce memory usage

Categories

(Core :: Disability Access APIs, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We avoid string attribute values in a lot of places now, but there are still at least two values we could probably atomize: font-family and language. Because these are currently copied down the tree rather than inherited from ancestors, there would be a lot of duplicates. Font-family is pretty much always present on every element. Language isn't always, but if it is set, it will be copied to all descendants. Perhaps we could come up with a way to inherit these from ancestors (though that raises some tricky questions regarding mutations), but even then, we're likely to see duplicates of these strings.

Doing this reduces the a11y cache size for html.spec.whatwg.org by about 15 mb while only increasing the atoms table size by about 3 mb. Many font family names and languages are shared across sites, which will often further mitigate the increase in atoms table size when several pages are loaded.

This reduces memory used by the cache, since the same font family and language strings often occur many times in the same document (and likely even across documents).

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/01ab2741180b Atomize font family and language a11y text attributes. r=morgan
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: