OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <body> |
| 3 <script src="../resources/runner.js"></script> |
| 4 <div id="container"></div> |
| 5 <script> |
| 6 // This test measures the lifecycle update performance when adding small |
| 7 // amounts of text to a large page. |
| 8 |
| 9 var initialTextCount = 20000; |
| 10 var initialText = ""; |
| 11 for (var i = 0; i < initialTextCount; i++) |
| 12 initialText += '<span>a</span>'; |
| 13 |
| 14 var textToAppendEachRun = 5; |
| 15 PerfTestRunner.measureFrameTime({ |
| 16 run: function() { |
| 17 var text = document.createElement('span'); |
| 18 text.innerText = 'abc'; |
| 19 container.appendChild(text); |
| 20 }, |
| 21 setup: function() { |
| 22 container.innerHTML = initialText; |
| 23 }, |
| 24 done: function() { |
| 25 container.innerHTML = ""; |
| 26 }, |
| 27 warmUpCount: 5, |
| 28 }); |
| 29 </script> |
| 30 </body> |
OLD | NEW |