OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
5 <title>Adding whitespace performance test</title> | |
6 <script src="../resources/runner.js"></script> | |
7 </head> | |
8 <body> | |
9 <pre id="log"></pre> | |
10 <div id="test"> | |
11 <div style="display: inline-block;"></div> | |
leviw_travelin_and_unemployed
2015/05/04 20:55:24
Nit: your whitespace test has too much whitespace
| |
12 <div> | |
leviw_travelin_and_unemployed
2015/05/04 20:55:24
</div>?
| |
13 <script> | |
14 var target = document.getElementById("test"); | |
15 function test() { | |
16 for (var i = 0; i < 100; i++) { | |
17 target.innerHTML += ' <div style="display: inline-block;"></di v> '; | |
esprehn
2015/05/04 21:22:40
This is serializing the DOM into a big string, des
| |
18 PerfTestRunner.forceLayoutOrFullFrame(); | |
esprehn
2015/05/04 21:22:40
This is forcing a full frame update, that means co
| |
19 } | |
20 target.innerHTML = '<div style="display: inline-block;"></div>'; | |
esprehn
2015/05/04 21:22:40
This is going to destroy all the nodes you created
| |
21 } | |
22 | |
23 PerfTestRunner.measureRunsPerSecond({ | |
24 description: "Measures performance of layout when adding whitespace to a div.", | |
leviw_travelin_and_unemployed
2015/05/04 20:55:24
This isn't the greatest description. Right now, yo
| |
25 run: test | |
26 }); | |
27 </script> | |
28 </body> | |
29 </html> | |
OLD | NEW |