iframeInner

Benchmark created by Eyal on


Description

Testing accessing javascript functions from a parent window. To run this test, you need to open the parent test window but run the tests in this window. The parent test window is http://jsperf.com/iframe

Preparation HTML

<script>
  var arrInner = [];
  for (var i = 0; i < 1000; i++)
  arrInner.push(i);
  
  function accessArrayInner(i) {
   return arrInner[i];
  }
  
  accessArrayTopCached = top.accessArrayTop;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
innerArray
var x = accessArrayInner(300);
ready
topArray
var x = top.accessArrayTop(300);
ready
topArrayCached
var x = accessArrayTopCached(300);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.