Convert CSS and Parser tests to runs/s tests
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 21:19:51 +0000 (21:19 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 21:19:51 +0000 (21:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86399

Reviewed by Ojan Vafai.

Use runPerSecond instead of run to measure results in function calls per second (run/s) instead of time (ms).
This allows us to continue measuring performance reliably even when WebKit's performance improves and results
become too small for Date.now()'s precision (around 15 ms).

It should also reduce perf. bots cycle time for slower tests because we limit the number of function calls by time.

* CSS/CSSPropertySetterGetter.html:
* CSS/CSSPropertyUpdateValue.html:
* Parser/css-parser-yui.html:
* Parser/simple-url.html:
* Parser/tiny-innerHTML.html:
* Parser/url-parser.html:
* Parser/xml-parser.html:

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

PerformanceTests/CSS/CSSPropertySetterGetter.html
PerformanceTests/CSS/CSSPropertyUpdateValue.html
PerformanceTests/ChangeLog
PerformanceTests/Parser/css-parser-yui.html
PerformanceTests/Parser/simple-url.html
PerformanceTests/Parser/tiny-innerHTML.html
PerformanceTests/Parser/url-parser.html
PerformanceTests/Parser/xml-parser.html

index f29d40b..445618c 100644 (file)
@@ -71,12 +71,12 @@ var properties = {
 'webkitTransform' : 'scale3d(0.5, 0.5, 0.5)',
 'wordSpacing' : '40px',
 };
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     for (key in properties) {
         var value = div.style[key];
         div.style[key] = "";
         div.style[key] = properties[key];
     }
-}, 5000);
+}});
 </script>
 </html>
index 51795b3..ae28d01 100644 (file)
@@ -72,9 +72,9 @@ var properties = {
 'wordSpacing' : '40px',
 };
 // The first run will just add the properties but it's fine as the first run of the benchmark is always ignored.
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     for (key in properties)
         div.style[key] = properties[key];
-}, 10000);
+}});
 </script>
 </html>
index 8bba6c9..01e1650 100644 (file)
@@ -1,3 +1,24 @@
+2012-05-14  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Convert CSS and Parser tests to runs/s tests
+        https://bugs.webkit.org/show_bug.cgi?id=86399
+
+        Reviewed by Ojan Vafai.
+
+        Use runPerSecond instead of run to measure results in function calls per second (run/s) instead of time (ms).
+        This allows us to continue measuring performance reliably even when WebKit's performance improves and results
+        become too small for Date.now()'s precision (around 15 ms).
+
+        It should also reduce perf. bots cycle time for slower tests because we limit the number of function calls by time.
+
+        * CSS/CSSPropertySetterGetter.html:
+        * CSS/CSSPropertyUpdateValue.html:
+        * Parser/css-parser-yui.html:
+        * Parser/simple-url.html:
+        * Parser/tiny-innerHTML.html:
+        * Parser/url-parser.html:
+        * Parser/xml-parser.html:
+
 2012-05-14  Dan Bernstein  <mitz@apple.com>
 
         Add a line layout performance test
index 4f63b1a..890338a 100644 (file)
@@ -2619,11 +2619,11 @@ legend {
 var element = document.getElementById("styleElement");
 var cssText = element.textContent;
 var count = 0;
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     element.textContent = "";
     element.textContent = cssText + "#some" + count + "{color:black};";
     count++;
-}, 100);
+}});
 
 </script>
 </body>
index 689527e..51ecb50 100644 (file)
@@ -3,10 +3,10 @@
 <script src="../resources/runner.js"></script>
 <script>
 var anchor = document.createElement("a");
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     for (var x = 0; x < 200000; x++) {
         anchor.href = "http://www.apple.com/"
     }
-});
+}});
 </script>
 </body>
index 07f0d92..9094a34 100644 (file)
@@ -2,7 +2,7 @@
 <body>
 <script src="../resources/runner.js"></script>
 <script>
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     var testDiv = document.createElement("div");
     testDiv.style.display = "none";
     document.body.appendChild(testDiv);
@@ -10,6 +10,6 @@ PerfTestRunner.run(function() {
         testDiv.innerHTML = "This is a tiny HTML document";
     }
     document.body.removeChild(testDiv);
-});
+}});
 </script>
 </body>
index 00b51e7..ecdbc41 100644 (file)
@@ -5,10 +5,10 @@
 var urls = PerfTestRunner.loadFile("resources/final-url-en").split("\n");
 var anchor = document.createElement("a");
 
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     for (var x = 0; x < urls.length; x++) {
         anchor.href = urls[x];
     }
-});
+}});
 </script>
 </body>
index b29eb84..122af33 100644 (file)
@@ -11,8 +11,8 @@ for (var i = 0; i < 0x7FFF; ++i)
 xmlArray.push('</root>')
 var xmlData = xmlArray.join('');
 
-PerfTestRunner.run(function() {
+PerfTestRunner.runPerSecond({run:function() {
     domParser.parseFromString(xmlData, "text/xml");
-});
+}});
 </script>
 </body>