Commit aa00397a authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Split UMA metric for Style.UpdateTime.

Measure style recalc and layout tree building separately. We now don't
create samples for UpdateStyle() calls where both style and layout trees
are clean.

Bug: 851782
Change-Id: Icfa94f5a231775cbd9ea0aa80b8b693502b3ca42
Reviewed-on: https://chromium-review.googlesource.com/1156512Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579731}
parent 01fca2bb
......@@ -2242,7 +2242,6 @@ void Document::UpdateStyle() {
TRACE_EVENT_BEGIN0("blink,blink_style", "Document::updateStyle");
RUNTIME_CALL_TIMER_SCOPE(V8PerIsolateData::MainThreadIsolate(),
RuntimeCallStats::CounterId::kUpdateStyle);
TimeTicks start_time = CurrentTimeTicks();
unsigned initial_element_count = GetStyleEngine().StyleForElementCount();
......@@ -2283,6 +2282,7 @@ void Document::UpdateStyle() {
if (Element* document_element = documentElement()) {
if (document_element->ShouldCallRecalcStyle(change)) {
TRACE_EVENT0("blink,blink_style", "Document::recalcStyle");
SCOPED_BLINK_UMA_HISTOGRAM_TIMER_HIGHRES("Style.RecalcTime");
Element* viewport_defining = ViewportDefiningElement();
ReattachLegacyLayoutObjectList legacy_layout_objects(*this);
legacy_layout_objects.WillRecalcStyle();
......@@ -2296,6 +2296,7 @@ void Document::UpdateStyle() {
if (document_element->NeedsReattachLayoutTree() ||
document_element->ChildNeedsReattachLayoutTree()) {
TRACE_EVENT0("blink,blink_style", "Document::rebuildLayoutTree");
SCOPED_BLINK_UMA_HISTOGRAM_TIMER_HIGHRES("Style.RebuildLayoutTreeTime");
ReattachLegacyLayoutObjectList legacy_layout_objects(*this);
WhitespaceAttacher whitespace_attacher;
document_element->RebuildLayoutTree(whitespace_attacher);
......@@ -2327,10 +2328,6 @@ void Document::UpdateStyle() {
"blink,blink_style", "Document::updateStyle", "resolverAccessCount",
GetStyleEngine().StyleForElementCount() - initial_element_count);
}
DEFINE_STATIC_LOCAL(CustomCountHistogram, update_histogram,
("Style.UpdateTime", 0, 10000000, 50));
update_histogram.CountMicroseconds(CurrentTimeTicks() - start_time);
}
void Document::ViewportDefiningElementDidChange() {
......
......@@ -98684,6 +98684,20 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Style.RebuildLayoutTreeTime" units="microseconds">
<owner>futhark@chromium.org</owner>
<summary>
Microseconds spent in RebuildLayoutTree called from Document::UpdateStyle.
</summary>
</histogram>
<histogram name="Style.RecalcTime" units="microseconds">
<owner>futhark@chromium.org</owner>
<summary>
Microseconds spent in RecalcStyle called from Document::UpdateStyle.
</summary>
</histogram>
<histogram name="Style.TotalLazyRules" units="count">
<obsolete>
Deprecated 07/2018, no longer used.
......@@ -98707,6 +98721,10 @@ uploading your change for review.
</histogram>
<histogram name="Style.UpdateTime" units="microseconds">
<obsolete>
Deprecated 07/2018, replaced by Style.RecalcTime and
Style.RebuildLayoutTreeTime.
</obsolete>
<owner>futhark@chromium.org</owner>
<summary>
Microseconds spent in Document::UpdateStyle.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment