Closed Bug 1519861 Opened 11 months ago Closed 10 months ago

Improve mozilla::GetTabSizes

Categories

(Toolkit :: Performance Monitoring, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: tarek, Assigned: tarek)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

Florian found out that this call triggers a recursive call of nsIDocument::AddSizeOfNodeTree that can be problematic on heavy DOMS.

In theory, one solution would be to cache the result of AddSizeOfNodeTree() at the document level. The cache invalidation would happen when the subtree is modified.

I am investigating on this.

Assignee: nobody → tarek

I'm attaching a screenshot of a profile showing he problem. Unfortunately the profile is full of personal information so I can't share it.

Depends on: 1526266

Introduces a generation number in dom::base::Document as well
as a cached version of TabSizes we can Get and Set.
When the document is changed, the cache is invalidated.

This change improves about:performance speed by avoiding
a heavy recursive call on big DOM trees via GetTabSizes() calls.
If the page does not change, the cached values are returned.

Pushed by tziade@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1e169e0e9d17
Improve mozilla::GetTabSizes - r=smaug
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.