blob: c9f205b9b4c266b3113f5e049ccd96456c289720 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
for (var i = 0; i < 1000; i++) {
var div = document.createElement("div");
div.id = "foo" + i;
div.className = "bar" + i;
document.body.appendChild(div);
}
var h1 = document.createElement("h1");
h1.id = "id";
h1.className = "class";
document.body.appendChild(h1);
PerfTestRunner.measureRunsPerSecond({
description: "This benchmark tests querySelectorAll() for an element that appears near the tail of the document",
run: function() {
for (var i = 0; i < 100; i++) {
document.querySelectorAll("h1");
document.querySelectorAll("#id");
document.querySelectorAll(".class");
}
}});
</script>
</body>
</html>