Closed Bug 789712 Opened 12 years ago Closed 10 years ago

[Profiler] Show what is triggering a reflow

Categories

(Core :: Gecko Profiler, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 926922

People

(Reporter: BenWa, Unassigned)

References

Details

Currently the most requested feature is to report what is triggering a reflow. I'm wondering if it's possible to call into the profiler when the layout info is marked dirty for the first first and maybe report which document that is if possible.

From there it should be easy for the UI to report and say which call initiated dirties and is partly responsible for the reflow.
(In reply to Benoit Girard (:BenWa) from comment #0)
> Currently the most requested feature is to report what is triggering a
> reflow. I'm wondering if it's possible to call into the profiler when the
> layout info is marked dirty for the first first and maybe report which
> document that is if possible.

I think that would be somewhat expensive.  Boris, do you have any ideas on what we can do here?
That depends on what you mean by "triggering".

We could try reporting when a reflow root is first added to the dirty reflow root list.  On the other hand, reporting when dirty bits are set on a per-frame basis is likely to be prohitively expensive.
I'm just looking to report the first thing that triggers a document to reflow. The profiler wouldn't have a good way to represent frames. With the first trigger per document the callstack should be enough context.
We don't reflow "a document".  We reflow a reflow root.  There can be multiple per document.

So yeah, notifying when we add a reflow root to the dirty list would be doable.
We'll need to solve bug 777828 first to unwind at a particular point rather then when we fire a sample so lets' get this solved soon.
Depends on: 777828
Benoit, do you still need more info from me here?
Thanks for the offer :). I'd like to know the specific to what, where and how to trace this.

Would it be possible to modify http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#2597 and check if it's the first reflow root added to the PresShell and if so log the callstack and tag it to the reflow?
I don't think you want to check whether it's the first root.  I think you want to log all reflow root additions.

Logging the callstack there seems reasonable.

What does "tag it to the reflow" mean?  We can certainly correlate it to when that same reflow root gets reflowed, if there's a mechanism for it....
Benoit, note that any solution which relies on walking the stack will only work on Nightly, so such a solution will never be useful to, let's say, web developers who want to run release builds of Firefox.
still a valuable feature. Do we have any idea how we could do this today in released versions?
We already have this underway as bug 926922.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.