Bug 1353900 - Add talos stylo bloom-basic test; r=jmaher
authorRob Wood <rwood@mozilla.com>
Thu, 06 Apr 2017 15:11:25 -0400
changeset 352701 ad206b7a264422e4d468db356931b0a0c3fa7bb6
parent 352700 e1fa99e13ff446c810f15041d8a978a554431243
child 352702 55e46fac1625903640f99cf32cafac545dcb2fdb
push id31643
push userkwierso@gmail.com
push dateWed, 12 Apr 2017 22:13:40 +0000
treeherdermozilla-central@ff7729561efd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1353900
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1353900 - Add talos stylo bloom-basic test; r=jmaher MozReview-Commit-ID: CYxto0ALXaZ
testing/talos/talos.json
testing/talos/talos/test.py
testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html
testing/talos/talos/tests/perf-reftest/bloom-basic.html
testing/talos/talos/tests/perf-reftest/bloom_basic.manifest
testing/talos/talos/tests/perf-reftest/bloom_basic_ref.manifest
testing/talos/talos/tests/perf-reftest/util.js
--- a/testing/talos/talos.json
+++ b/testing/talos/talos.json
@@ -76,16 +76,22 @@
         },
         "svgr": {
             "tests": ["tsvgx", "tsvgr_opacity", "tart", "tscrollx", "cart", "tsvg_static"],
             "talos_options": ["--disable-e10s"]
         },
         "svgr-e10s": {
             "tests": ["tsvgx", "tsvgr_opacity", "tart", "tscrollx", "cart", "tsvg_static"]
         },
+        "perf-reftest": {
+            "tests": ["bloom_basic", "bloom_basic_ref"]
+        },
+        "perf-reftest-e10s": {
+            "tests": ["bloom_basic", "bloom_basic_ref"]
+        },
         "tp5o": {
             "tests": ["tp5o"],
             "pagesets_name": "tp5n.zip",
             "talos_options": ["--disable-e10s"]
         },
         "tp5o-e10s": {
             "tests": ["tp5o"],
             "pagesets_name": "tp5n.zip"
--- a/testing/talos/talos/test.py
+++ b/testing/talos/talos/test.py
@@ -723,8 +723,38 @@ class a11yr(PageloaderTest):
     """
     tpmanifest = '${talos}/tests/a11y/a11y.manifest'
     tpcycles = 1
     tppagecycles = 25
     tpmozafterpaint = True
     preferences = {'dom.send_after_paint_to_content': False}
     unit = 'ms'
     alert_threshold = 5.0
+
+
+@register_test()
+class bloom_basic(PageloaderTest):
+    """
+    Stylo bloom_basic test
+    """
+    tpmanifest = '${talos}/tests/perf-reftest/bloom_basic.manifest'
+    tpcycles = 1
+    tppagecycles = 25
+    gecko_profile_interval = 1
+    gecko_profile_entries = 2000000
+    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
+    unit = 'ms'
+    lower_is_better = True
+
+
+@register_test()
+class bloom_basic_ref(PageloaderTest):
+    """
+    Stylo bloom_basic_ref test
+    """
+    tpmanifest = '${talos}/tests/perf-reftest/bloom_basic_ref.manifest'
+    tpcycles = 1
+    tppagecycles = 25
+    gecko_profile_interval = 1
+    gecko_profile_entries = 2000000
+    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
+    unit = 'ms'
+    lower_is_better = True
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest/bloom-basic-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src="util.js"></script>
+    <script>
+window.onload = function() {
+  document.head.appendChild(build_rule("span > div", 10000, '{ color: "blue"; } '));
+  let dom = build_dom(5000, "div");
+
+  let start = performance.now();
+  document.body.appendChild(dom);
+  window.foo = window.getComputedStyle(document.body).color;
+  let end = performance.now();
+
+  // when running in talos report results; when running outside talos just alert
+  if (window.tpRecordTime) {
+    window.tpRecordTime(end - start, start);
+  } else {
+    console.log(end);
+    console.log(start);
+    alert("Result: " + (end - start).toFixed(2) + " (ms)");
+  }
+}
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest/bloom-basic.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src="util.js"></script>
+    <script>
+window.onload = function() {
+  document.head.appendChild(build_rule("span div", 10000, '{ color: "blue"; } '));
+  let dom = build_dom(5000, "div");
+
+  let start = performance.now();
+  document.body.appendChild(dom);
+  window.foo = window.getComputedStyle(document.body).color;
+  let end = performance.now();
+
+  // when running in talos report results; when running outside talos just alert
+  if (window.tpRecordTime) {
+    window.tpRecordTime(end - start, start);
+  } else {
+    console.log(end);
+    console.log(start);
+    alert("Result: " + (end - start).toFixed(2) + " (ms)");
+  }
+}
+    </script>
+  </head>
+  <body>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest/bloom_basic.manifest
@@ -0,0 +1,1 @@
+% http://localhost/tests/perf-reftest/bloom-basic.html
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest/bloom_basic_ref.manifest
@@ -0,0 +1,1 @@
+% http://localhost/tests/perf-reftest/bloom-basic-ref.html
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest/util.js
@@ -0,0 +1,17 @@
+function build_dom(n, elemName) {
+  var ours = document.createElement(elemName);
+  if (n != 1) {
+    var leftSize = Math.floor(n/2);
+    var rightSize = Math.floor((n-1)/2);
+    ours.appendChild(build_dom(leftSize, elemName));
+    if (rightSize > 0)
+      ours.appendChild(build_dom(rightSize, elemName));
+  }
+  return ours;
+}
+
+function build_rule(selector, selectorRepeat, declaration) {
+  var s = document.createElement("style");
+  s.textContent = Array(selectorRepeat).fill(selector).join(", ") + declaration;
+  return s;
+}