Commit 78fb8151 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

[Rendering UKM] Fix ForcedStyleAndLayout metric

The ForcedStyleAndLayout metric is very very high under the new sampling
approach. The root cause is JS being scheduled outside of the main frame
period, in which case we keep adding up the JS time but never reset it
until a main frame actually happens and we record.

This patch should improve things by resetting even when we are not
in a begin main frame block, forcing the ForcedStuyleAndLayout timers
to reset even if no lifecycle work was done on that frame.

Bug: 959798
Change-Id: Icdd107f04444b7780a7f28158598b3ccddb70d7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1599773
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657411}
parent ee7f2057
......@@ -145,8 +145,12 @@ void LocalFrameUkmAggregator::RecordEndOfFrameMetrics(TimeTicks start,
// Any of the early out's in LocalFrameView::UpdateLifecyclePhases
// will mean we are not in a main frame update. Recording is triggered
// higher in the stack, so we cannot know to avoid calling this method.
if (!in_main_frame_update_)
if (!in_main_frame_update_) {
// Reset for the next frame to start the next recording period with
// clear counters, even when we did not record anything this frame.
ResetAllMetrics();
return;
}
in_main_frame_update_ = false;
TimeDelta duration = end - start;
......
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