<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
// Taken from http://jsperf.com/parse-html-type
// The major difference between this test and innerHTML-setter.html
// is that innerHTML-setter creates a single root node
// which avoids some of the costs in transplating nodes from the
// intermediary DocumentFragment to its final parent.
var tags = '<div></div><div></div><div></div><div></div><div></div>';
var attr = '<div foo="bar" foo="bar" foo="bar" foo="bar sda"></div>';
var nest = '<div><div><div><div><div></div></div></div></div></div>';

var tags10 = tags + tags + tags + tags + tags + tags + tags + tags + tags + tags;
var attr10 = attr + attr + attr + attr + attr + attr + attr + attr + attr + attr;
var nest10 = nest + nest + nest + nest + nest + nest + nest + nest + nest + nest;

var div = document.createElement('div');

PerfTestRunner.measureRunsPerSecond({
    description: "This benchmark tests innerHTML setter for a large DOM tree",
    run: function() {
        div.innerHTML = tags10;
        div.innerHTML = attr10;
        div.innerHTML = nest10;
        div.innerHTML = "";
    }});
</script>
</body>
</html>

Add test for innerHTML with a wide DOM
Add test for innerHTML with a wide DOM

We already have a test for testing a "large" DOM
but it only has a single root node, which avoided
some hot paths.

This test is based off of http://jsperf.com/parse-html-type
which was written by a member of the Google+ team who noticed
a regression in our innerHTML performance as of late.

This is a tiny microbenchmark, which happens to catch some
of this regression, but probably isn't one we should
spend a lot of time optimizing (we're already very very fast).

On my machine this clocks at about 6,000 operations per second.

BUG=318251

Review URL: https://codereview.chromium.org/70953002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@162960 bbb929c8-8fbe-4397-9dbb-9b2b20218538
