OLD | NEW |
1 <sky> | 1 <sky> |
2 <import src="../resources/runner.sky" as="PerfRunner" /> | 2 <import src="../resources/runner.sky" as="PerfRunner" /> |
3 <script> | 3 <script> |
4 var sky = document.querySelector("sky"); | 4 var sky = document.querySelector("sky"); |
5 | 5 |
6 var widgets = 0; | 6 var widgets = 0; |
7 var basicElements = 0; | 7 var basicElements = 0; |
8 var texts = 0; | 8 var texts = 0; |
9 | 9 |
10 var WidgetPrototype = Object.create(HTMLElement.prototype); | 10 var WidgetPrototype = Object.create(HTMLElement.prototype); |
(...skipping 26 matching lines...) Expand all Loading... |
37 prototype: WidgetPrototype, | 37 prototype: WidgetPrototype, |
38 }); | 38 }); |
39 | 39 |
40 function createElement(tagName) { | 40 function createElement(tagName) { |
41 basicElements++; | 41 basicElements++; |
42 return document.createElement(tagName); | 42 return document.createElement(tagName); |
43 } | 43 } |
44 | 44 |
45 function createText(text) { | 45 function createText(text) { |
46 texts++; | 46 texts++; |
47 return document.createTextNode(text); | 47 return new Text(text); |
48 } | 48 } |
49 | 49 |
50 function createElements(root, depth) { | 50 function createElements(root, depth) { |
51 for (var i = 0; i < 4; i++) { | 51 for (var i = 0; i < 4; i++) { |
52 var div = createElement("div"); | 52 var div = createElement("div"); |
53 var span1 = div.appendChild(createElement("span")); | 53 var span1 = div.appendChild(createElement("span")); |
54 span1.appendChild(createText("foo")); | 54 span1.appendChild(createText("foo")); |
55 span1.setAttribute("id", "span" + (i * depth)); | 55 span1.setAttribute("id", "span" + (i * depth)); |
56 div.appendChild(createText(" ")); | 56 div.appendChild(createText(" ")); |
57 div.setAttribute("class", "b" + i + " a" + i); | 57 div.setAttribute("class", "b" + i + " a" + i); |
(...skipping 27 matching lines...) Expand all Loading... |
85 // console.log("widgets: " + widgets); | 85 // console.log("widgets: " + widgets); |
86 // console.log("basic elements: " + basicElements); | 86 // console.log("basic elements: " + basicElements); |
87 // console.log("texts: " + texts); | 87 // console.log("texts: " + texts); |
88 // CONSOLE: LOG: widgets: 340 | 88 // CONSOLE: LOG: widgets: 340 |
89 // CONSOLE: LOG: basic elements: 1021 | 89 // CONSOLE: LOG: basic elements: 1021 |
90 // CONSOLE: LOG: texts: 1020 | 90 // CONSOLE: LOG: texts: 1020 |
91 done(); | 91 done(); |
92 }); | 92 }); |
93 </script> | 93 </script> |
94 </sky> | 94 </sky> |
OLD | NEW |