summaryrefslogtreecommitdiffstats
path: root/testing/talos/talos/tests/perf-reftest-singletons/id-getter-2.html
blob: 1751f73359385a24f96feb844aa5a805ca7a68fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html>
<script src="util.js"></script>
<script>
onload = function() {
  var count = 20000000;
  var el = document.createElement("span");
  // The longest string we can fit in a single-byte inline string (16 chars).
  el.id = "aaaaaaaaaaaaaaaa";
  var getter = Object.getOwnPropertyDescriptor(Element.prototype, "id").get;
  perf_start();
  for (var i = 0; i < count; ++i) {
    getter.call(el);
  }
  perf_finish();
};
</script>