zalan@apple.com | c461d3e | 2015-04-09 18:57:33 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>innerText performance test with simple line layout.</title> |
| 5 | <script src="../resources/runner.js"></script> |
| 6 | </head> |
| 7 | <body> |
| 8 | <pre id="log"></pre> |
| 9 | <div id="target" style="width: 300px;"></div> |
| 10 | <div id="result"></div> |
| 11 | <script> |
| 12 | var target = document.getElementById("target"); |
| 13 | var result = document.getElementById("result"); |
| 14 | for (i = 0; i < 500; ++i) |
| 15 | target.appendChild(document.createTextNode("foobar")); |
| 16 | |
| 17 | function test() { |
| 18 | for (i = 0; i < 10; ++i) |
| 19 | result.innerText += target.innerText; |
| 20 | result.innerText = ""; |
| 21 | } |
zalan@apple.com | 3511235 | 2015-04-13 18:04:55 +0000 | [diff] [blame] | 22 | |
| 23 | function done() { |
| 24 | target.innerHTML = ""; |
| 25 | } |
| 26 | |
| 27 | PerfTestRunner.measureRunsPerSecond({ run: test, done: done }); |
zalan@apple.com | c461d3e | 2015-04-09 18:57:33 +0000 | [diff] [blame] | 28 | </script> |
| 29 | </body> |
| 30 | </html> |