Closed
Bug 908987
Opened 11 years ago
Closed 9 years ago
NotifyDidPaintForSubtree is slow when there are lots of open browsing contexts
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: smaug, Assigned: dbaron)
Details
Attachments
(1 file)
The method seems to go through each descendant document and then each child traverses up to root prescontext (at least if mFireAfterPaintEvents is false). Do we really need to go through also all the background tabs in case the method is called on root presshell? (Saw NotifyDidPaintForSubtree in profiles when looking at Bug 854100 in a browser which had lots of tabs open)
Assignee | ||
Comment 1•9 years ago
|
||
I think bug 1078005 fixed the actual firing of after-paint events, but there's still a lot of time spent in NotifyDidPaintForSubtree, mostly in nsFrameList::FrameAt called from nsIFrame::IsVisibleConsideringAncestors.
Assignee | ||
Comment 2•9 years ago
|
||
That call stack is actually (with the tail call optimization removed): nsFrameList::FrameAt nsDeckFrame::GetSelectedBox nsIFrame::IsVisibleConsideringAncestors PresShell::IsVisible nsPresContext::NotifyDidPaintForSubtree
Assignee | ||
Comment 3•9 years ago
|
||
... I suspect that may be fixable by making PresShell::IsVisible use mIsActive more aggressively, which would be part of the way towards fixing bug 465216.
Assignee | ||
Comment 4•9 years ago
|
||
(Note that the nsFrameList::FrameAt calls make the algorithm O(N^2), since we're searching the deck frame's child list for each child in turn.)
Comment hidden (obsolete) |
Assignee | ||
Comment 6•9 years ago
|
||
And a try run on top of a good revision, this time: https://hg.mozilla.org/try/pushloghtml?changeset=dfa8e027d0d7 https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=dfa8e027d0d7 https://tbpl.mozilla.org/?tree=Try&rev=dfa8e027d0d7
Assignee | ||
Comment 7•9 years ago
|
||
(Note that in some sense this patch is rewriting bug 1096076 more aggressively.)
Assignee | ||
Comment 8•9 years ago
|
||
This means that we avoid an O(N^2) calling pattern of IsVisible when we call IsVisible for all tabs of a tabbrowser, since in a tabbrowser (which uses an nsDeckFrame), IsVisibleConsideringAncestors is O(N) in number of earlier tabs.
Attachment #8547395 -
Flags: review?(roc)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #8547395 -
Flags: review?(roc) → review+
Assignee | ||
Comment 9•9 years ago
|
||
https://hg.mozilla.org/try/pushloghtml?changeset=83d5de58d42a https://treeherder.mozilla.org/#/jobs?repo=try&revision=83d5de58d42a https://tbpl.mozilla.org/?tree=Try&rev=83d5de58d42a
Assignee | ||
Comment 10•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7d3ef4f3fa8f
Comment 11•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7d3ef4f3fa8f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•