Improvements to Animometer benchmark
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jun 2016 03:12:26 +0000 (03:12 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jun 2016 03:12:26 +0000 (03:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157738

Reviewed by Dean Jackson.
Provisionally reviewed by Said Abou-Hallawa.

Update tests.

* Animometer/tests/master/text.html: Ensure only three text sizes for
the three canvases.
* Animometer/tests/master/focus.html: Reduce the text size to fit with smaller
particle sizes.
* Animometer/tests/master/resources/focus.js: Remove the quadratic distribution for
particle sizes, and make it linear. Reduce the size variance. Shuffle the math to
reduce some calculations per frame. Fix the placement of the particles which might
otherwise be culled.
* Animometer/tests/master/resources/image-data.js: Reduce the particle size
to encourage larger scores.

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

PerformanceTests/Animometer/tests/master/focus.html
PerformanceTests/Animometer/tests/master/resources/focus.js
PerformanceTests/Animometer/tests/master/resources/image-data.js
PerformanceTests/Animometer/tests/master/text.html
PerformanceTests/ChangeLog

index 731256d..02264d7 100644 (file)
@@ -21,6 +21,7 @@
     }
 
     #center-text {
+        font-size: 90%;
         transform: translate3d(-50%, -50%, 0);
     }
 
index 5672897..26c2465 100644 (file)
@@ -1,27 +1,25 @@
 (function() {
 
 var maxVerticalOffset = 50;
-var radius = 10;
-var centerDiameter = 100;
-var sizeVariance = 80;
-var travelDistance = 70;
-
-var minObjectDepth = 0.2;
-var maxObjectDepth = 1.0;
+var minimumDiameter = 30;
+var centerDiameter = 90;
+var sizeVariance = 60;
+var travelDistance = 50;
 
 var opacityMultiplier = 30;
 
 var FocusElement = Utilities.createClass(
     function(stage)
     {
-        var topOffset = maxVerticalOffset * Stage.randomSign();
-        var top = Stage.random(0, stage.size.height - 2 * radius - sizeVariance);
-        var left = Stage.random(0, stage.size.width - 2 * radius - sizeVariance);
+        var size = minimumDiameter + sizeVariance;
 
         // size and blurring are a function of depth
-        this._depth = Utilities.lerp(1 - Math.pow(Pseudo.random(), 2), minObjectDepth, maxObjectDepth);
-        var distance = Utilities.lerp(this._depth, 1, sizeVariance);
-        var size = 2 * radius + sizeVariance - distance;
+        this._depth = Pseudo.random();
+        var distance = Utilities.lerp(this._depth, 0, sizeVariance);
+        size -= distance;
+
+        var top = Stage.random(0, stage.size.height - size) - stage.maxBlurValue * 3;
+        var left = Stage.random(0, stage.size.width - size) - stage.maxBlurValue * 3;
 
         this.container = document.createElement('div');
         this.container.style.width = (size + stage.maxBlurValue * 6) + "px";
@@ -30,16 +28,15 @@ var FocusElement = Utilities.createClass(
         this.container.style.left = left + "px";
         this.container.style.zIndex = Math.round((1 - this._depth) * 10);
 
-        var particle = Utilities.createElement("div", {}, this.container);
-        particle.style.width = size + "px";
-        particle.style.height = size + "px";
-        particle.style.top = (stage.maxBlurValue * 3) + "px";
-        particle.style.left = (stage.maxBlurValue * 3) + "px";
-        this.particle = particle;
+        this.particle = Utilities.createElement("div", {}, this.container);
+        this.particle.style.width = size + "px";
+        this.particle.style.height = size + "px";
+        this.particle.style.top = (stage.maxBlurValue * 3) + "px";
+        this.particle.style.left = (stage.maxBlurValue * 3) + "px";
 
         var depthMultiplier = Utilities.lerp(1 - this._depth, 0.8, 1);
-        this._sinMultiplier = Pseudo.random() * Stage.randomSign() * depthMultiplier;
-        this._cosMultiplier = Pseudo.random() * Stage.randomSign() * depthMultiplier;
+        this._sinMultiplier = Pseudo.random() * Stage.randomSign() * depthMultiplier * travelDistance;
+        this._cosMultiplier = Pseudo.random() * Stage.randomSign() * depthMultiplier * travelDistance;
     }, {
 
     hide: function()
@@ -131,8 +128,8 @@ var FocusStage = Utilities.createSubclass(Stage,
     animate: function()
     {
         var time = this._benchmark.timestamp;
-        var sinFactor = Math.sin(time / this.movementDuration) * travelDistance;
-        var cosFactor = Math.cos(time / this.movementDuration) * travelDistance;
+        var sinFactor = Math.sin(time / this.movementDuration);
+        var cosFactor = Math.cos(time / this.movementDuration);
 
         var focusProgress = 0.5 + 0.5 * Math.sin(time / this.focusDuration);
         this._focalPoint = focusProgress;
index 7a028f2..6de5d06 100644 (file)
@@ -8,10 +8,10 @@ var ImageDataStage = Utilities.createSubclass(Stage,
         this._offsetIndex = 0;
     }, {
 
-    imageWidth: 100,
-    imageHeight: 100,
+    imageWidth: 50,
+    imageHeight: 50,
     pixelStride: 4,
-    rowStride: 400,
+    rowStride: 200,
     weightNegativeThreshold: 0.04,
     weightPositiveThreshold: 0.96,
     imageSrcs: [
index 4c9dde1..5e94b8c 100644 (file)
@@ -7,28 +7,15 @@
 
         #stage {
             font-family: Helvetica;
-            font-size: 48px;
-            background-color: #313534;/* #d1948c;*/
+            font-size: 52px;
+            background-color: #313534;
         }
-        @media (min-device-height: 768px) and (max-device-height: 1024px) {
+        @media (max-width: 900px) {
             #stage {
                 font-size: 40px;
             }
         }
-        @media screen and (max-device-width: 414px),
-            screen and (max-device-height: 414px) and (orientation: landscape) {
-            #stage {
-                font-size: 36px;
-            }
-        }
-        @media screen and (max-device-width: 375px),
-            screen and (max-device-height: 375px) and (orientation: landscape) {
-            #stage {
-                font-size: 30px;
-            }
-        }
-        @media screen and (max-device-width: 320px),
-            screen and (max-device-height: 320px) and (orientation: landscape) {
+        @media (max-width: 568px) {
             #stage {
                 font-size: 28px;
             }
index 9226095..55957f1 100644 (file)
@@ -6,6 +6,27 @@
         Reviewed by Dean Jackson.
         Provisionally reviewed by Said Abou-Hallawa.
 
+        Update tests.
+
+        * Animometer/tests/master/text.html: Ensure only three text sizes for
+        the three canvases.
+        * Animometer/tests/master/focus.html: Reduce the text size to fit with smaller
+        particle sizes.
+        * Animometer/tests/master/resources/focus.js: Remove the quadratic distribution for
+        particle sizes, and make it linear. Reduce the size variance. Shuffle the math to
+        reduce some calculations per frame. Fix the placement of the particles which might
+        otherwise be culled.
+        * Animometer/tests/master/resources/image-data.js: Reduce the particle size
+        to encourage larger scores.
+
+2016-06-21  Jon Lee  <jonlee@apple.com>
+
+        Improvements to Animometer benchmark
+        https://bugs.webkit.org/show_bug.cgi?id=157738
+
+        Reviewed by Dean Jackson.
+        Provisionally reviewed by Said Abou-Hallawa.
+
         Include confidence interval for the final score, and store the canvas
         size in the serialization so that it is accurately shown in results.