Closed
Bug 1444296
Opened 7 years ago
Closed 7 years ago
Include some traversal statistics in style tracing marker
Categories
(Core :: Gecko Profiler, enhancement, P1)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla61
People
(Reporter: xidorn, Assigned: xidorn)
References
Details
(Whiteboard: [perf-tools])
Attachments
(4 files, 1 obsolete file)
With parallel traversal, we don't include details of style threads in profile by default (and we don't want to either). This makes us completely blind on what's happening inside a restyles.
It may make sense to include some of statistics we are already collecting during traversal (as TraversalStatistics) into profile, so that we at least have some clue for long restyles in profile.
My feeling is that elements_{traversed,styled,matched} are probably the most interesting ones.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → xidorn+moz
Comment 1•7 years ago
|
||
There is some small amount of overhead during the collection phase. Can we gate that on the profiler being enabled?
Assignee | ||
Comment 2•7 years ago
|
||
I suspect gating them has a higher overhead than simply collecting them...
We should still gate them in the same way for merging the collected data, though.
Comment 3•7 years ago
|
||
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #2)
> I suspect gating them has a higher overhead than simply collecting them...
>
> We should still gate them in the same way for merging the collected data,
> though.
Yeah, that's what I meant. Sounds like we're on the same page.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 6•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8958051 -
Flags: review?(mstange)
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8958046 [details]
Bug 1444296 part 1 - Have servo report traversal statistics to gecko.
https://reviewboard.mozilla.org/r/226982/#review232824
I think we should fix up the statistics types to make things more clear.
Right now there are some stats that are gathered per-thread and then aggregated, whereas others are collected at the end via finish(). The type system doesn't enforce correctness here, making mistakes possible, and this patch makes the meaning of |finish| even less clear (since we don't call it for the |report| case).
So I think we should separate out the per-thread things into a TraversalStatisticsInner, and replace TraversalStatistics::finish() with a TraversalStatistics::new() that takes a TraversalStatisticsInner along with the other necessary bits. Then when we're reporting but not dumping, we can just collect and aggregated TraversalStatisticsInner instances, and then the dump code can construct a TraversalStatistics afterwards if it wants.
::: layout/style/ServoTraversalStatistics.h:26
(Diff revision 1)
> + uint32_t mElementsMatched = 0;
> + uint32_t mStylesShared = 0;
> + uint32_t mStylesReused = 0;
> +
> + static bool sActive;
> + static ServoTraversalStatistics sStats;
Let's call this |singleton|.
Attachment #8958046 -
Flags: review?(bobbyholley) → review-
Updated•7 years ago
|
Updated•7 years ago
|
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 11•7 years ago
|
||
mozreview-review |
Comment on attachment 8958284 [details]
Split TraversalStatistics into two parts.
https://reviewboard.mozilla.org/r/227212/#review233018
This looks great, thanks. Please test that DUMP_STYLE_STATISTICS=1 still works on top of your patches.
r=me with that
::: servo/components/style/context.rs:328
(Diff revision 1)
> + }
> + }
> +}
> +
> +/// Statistics gathered during the traversal plus some other information
> +/// get from other sources including stylist.
s/get//
Attachment #8958284 -
Flags: review?(bobbyholley) → review+
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8958046 [details]
Bug 1444296 part 1 - Have servo report traversal statistics to gecko.
https://reviewboard.mozilla.org/r/226982/#review233022
Attachment #8958046 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 13•7 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #11)
> This looks great, thanks. Please test that DUMP_STYLE_STATISTICS=1 still
> works on top of your patches.
Yeah, it still works.
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8958047 [details]
Bug 1444296 part 2 - Have a separate marker for styles to present stats.
https://reviewboard.mozilla.org/r/226984/#review233588
Attachment #8958047 -
Flags: review?(mstange) → review+
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8958284 [details]
Split TraversalStatistics into two parts.
https://reviewboard.mozilla.org/r/227212/#review233600
::: servo/components/style/context.rs:314
(Diff revision 1)
> /// StyleSharingCache.
> pub styles_reused: u32,
> +}
> +
> +/// Implementation of Add to aggregate statistics across different threads.
> +impl<'a> ops::Add for &'a TraversalStatisticsInner {
Drive-by (sorry!), but... maybe `PerThreadTraversalStatistics`, calling the `inner` member something like `aggregated` instead?
Not ultra-fond of the name either, I just dislike the `FooInner` stuff a bit :).
Feel free to not change it if you don't think it's better / worth it.
Comment 16•7 years ago
|
||
Comment on attachment 8958051 [details] [review]
perf.html pull request
Julien has r+ed this in https://github.com/devtools-html/perf.html/pull/852 .
Attachment #8958051 -
Flags: review?(mstange)
Comment 17•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #15)
> Drive-by (sorry!), but... maybe `PerThreadTraversalStatistics`, calling the
> `inner` member something like `aggregated` instead?
SGTM
Assignee | ||
Comment 18•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8958284 -
Attachment is obsolete: true
Comment 21•7 years ago
|
||
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ab2df71dc9de
part 1 - Have servo report traversal statistics to gecko. r=bholley
https://hg.mozilla.org/integration/autoland/rev/7701560f1b14
part 2 - Have a separate marker for styles to present stats. r=mstange
Comment 22•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ab2df71dc9de
https://hg.mozilla.org/mozilla-central/rev/7701560f1b14
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Updated•7 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•