Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(897)

Side by Side Diff: PerformanceTests/Layout/AddWhitespace.html

Issue 1126673002: Test out performance when adding whitespace to the DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
esprehn 2015/05/04 22:14:38 Leave out html, head, body and title.
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"></div>
11 <script>
12 var target = document.getElementById("test");
13 function test() {
14 target.innerHTML = '<div style="display: inline-block;"></div>';
esprehn 2015/05/04 22:14:38 Why inline block?
15 for (var i = 0; i < 1000; i++) {
16 var testElement = document.createTextNode(" ");
esprehn 2015/05/04 22:14:38 This is not very realistic, pages don't have huge
17 target.insertBefore(testElement, target.firstChild);
18 }
19 document.body.offsetTop;
20 }
21
22 PerfTestRunner.measureRunsPerSecond({
23 description: "Is sensitive to the performance of layout when adding whitespace to a div.",
24 run: test
25 });
26 </script>
27 </body>
28 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698