Commit f5b05fe2 authored by ernstm@chromium.org's avatar ernstm@chromium.org

cc: Fixed computation of dropped frames.

- Computation of dropped frames now correctly accounts for multi-frame drops.
- A welcome side-effect is that variance of the percentage_dropped metric
  is reduced significantly.
- Heads-up for the perf sherrifs: percentage_dropped will increase quite a bit
  with this patch.

R=tonyg@chromium.org, nduca@chromium.org
BUG=264308

Review URL: https://chromiumcodereview.appspot.com/23998002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221825 0039d316-1c4b-4281-b951-d872f2087c98
parent 2fb9bd24
...@@ -73,7 +73,8 @@ void FrameRateCounter::SaveTimeStamp(base::TimeTicks timestamp, bool software) { ...@@ -73,7 +73,8 @@ void FrameRateCounter::SaveTimeStamp(base::TimeTicks timestamp, bool software) {
if (!IsBadFrameInterval(frame_interval_seconds) && if (!IsBadFrameInterval(frame_interval_seconds) &&
frame_interval_seconds.InSecondsF() > kDroppedFrameTime) frame_interval_seconds.InSecondsF() > kDroppedFrameTime)
++dropped_frame_count_; dropped_frame_count_ +=
frame_interval_seconds.InSecondsF() / kDroppedFrameTime;
} }
bool FrameRateCounter::IsBadFrameInterval( bool FrameRateCounter::IsBadFrameInterval(
......
...@@ -149,10 +149,11 @@ ...@@ -149,10 +149,11 @@
RafRenderingStats.prototype.getDroppedFrameCount_ = function(frameTimes) { RafRenderingStats.prototype.getDroppedFrameCount_ = function(frameTimes) {
var droppedFrameCount = 0; var droppedFrameCount = 0;
var droppedFrameThreshold = 1000 / 55;
for (var i = 1; i < frameTimes.length; i++) { for (var i = 1; i < frameTimes.length; i++) {
var frameTime = frameTimes[i] - frameTimes[i-1]; var frameTime = frameTimes[i] - frameTimes[i-1];
if (frameTime > 1000 / 55) if (frameTime > droppedFrameThreshold)
droppedFrameCount++; droppedFrameCount += Math.floor(frameTime / droppedFrameThreshold);
} }
return droppedFrameCount; return droppedFrameCount;
}; };
......
...@@ -157,8 +157,8 @@ def CalcResults(benchmark_stats, results): ...@@ -157,8 +157,8 @@ def CalcResults(benchmark_stats, results):
round(Median(frame_times), 2)) round(Median(frame_times), 2))
results.Add('dropped_percent', '%', results.Add('dropped_percent', '%',
Average(s.dropped_frame_count, s.screen_frame_count, Average(s.dropped_frame_count,
100, 1), s.screen_frame_count + s.dropped_frame_count, 100, 1),
data_type='unimportant') data_type='unimportant')
results.Add('percent_impl_scrolled', '%', results.Add('percent_impl_scrolled', '%',
Average(s.impl_thread_scroll_count, Average(s.impl_thread_scroll_count,
......
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