Animometer computes frame rate incorrectly
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 01:28:23 +0000 (01:28 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 01:28:23 +0000 (01:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150698

Reviewed by Tim Horton.

The existing code incremented this._frameCount after checking against this._dropFrameCount.
This has the effect of setting this._measureTimeOffset one frame too late, so
we were measuring only two frames, not three, and thus computing an incorrect fps.

* Animometer/tests/resources/main.js:
(Animator.prototype.animate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Animometer/tests/resources/main.js
PerformanceTests/ChangeLog

index 393d79f..ea77ceb 100644 (file)
@@ -94,12 +94,12 @@ Animator.prototype =
         if (!this._frameCount)
             this._startTimeOffset = this._currentTimeOffset;
 
+        ++this._frameCount;
+
         // Start measuring after dropping _dropFrameCount frames.
         if (this._frameCount == this._dropFrameCount)
             this._measureTimeOffset = this._currentTimeOffset;
 
-        ++this._frameCount;
-
         // Drop _dropFrameCount frames and measure the average of _measureFrameCount frames.
         if (this._frameCount < this._dropFrameCount + this._measureFrameCount)
             return true;
index 28ba618..3b9cae1 100644 (file)
@@ -1,3 +1,17 @@
+2015-10-29  Simon Fraser  <simon.fraser@apple.com>
+
+        Animometer computes frame rate incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=150698
+
+        Reviewed by Tim Horton.
+        
+        The existing code incremented this._frameCount after checking against this._dropFrameCount.
+        This has the effect of setting this._measureTimeOffset one frame too late, so
+        we were measuring only two frames, not three, and thus computing an incorrect fps.
+
+        * Animometer/tests/resources/main.js:
+        (Animator.prototype.animate):
+
 2015-10-27  Jon Lee  <jonlee@apple.com>
 
         Add an option to make the graphics benchmark runs a specific test