• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<html>
3<body>
4<div id="foo"></div>
5<script src="../resources/runner.js"></script>
6<script>
7for (var i = 0; i < 1000; i++) {
8    document.body.appendChild(document.createElement("div"));
9}
10var divs = document.getElementsByTagName("div");
11
12PerfTestRunner.measureRunsPerSecond({
13    description: "This benchmark measures performance of indexed property getters.",
14    run: function() {
15        var localDivs = divs;
16        for (var i = 0; i < 1000; i++)
17            localDivs[i];
18}});
19</script>
20</body>
21</html>
22