Home | History | Annotate | Download | only in Parser
      1 <!DOCTYPE html>
      2 <html>
      3 <body>
      4 <script src="../resources/runner.js"></script>
      5 <script>
      6 function generateBinDOMTree(depth) {
      7   return depth == 0 ? "text" : ("<div>" + generateBinDOMTree(depth - 1) + generateBinDOMTree(depth - 1) + "</div>");
      8 }
      9 
     10 var div = document.createElement("div");
     11 document.body.appendChild(div);
     12 var tree = generateBinDOMTree(10);
     13 
     14 PerfTestRunner.measureRunsPerSecond({
     15     description: "This benchmark tests innerHTML setter for a large DOM tree",
     16     run: function() {
     17         div.innerHTML = tree;
     18         div.innerHTML = "";
     19     }});
     20 </script>
     21 </body>
     22 </html>
     23