Setup cost of image vs iframe

Benchmark created by William Grose on


Setup

window.ifr = null;
  window.img = null;

Teardown



            img = null;
  if (ifr && ifr.parentNode != null) {
    ifr.parentNode.removeChild(ifr);
  }
  ifr = null;
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
Image creation and property test
img = document.createElement('img');
var supported = 'referrerPolicy' in img;
ready
Iframe creation test
ifr = document.createElement('iframe');
ifr.style.display = 'none';
ifr.id = 'anon-iframe';
document.body.appendChild(ifr);
ready

Revisions

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

  • Revision 1: published by William Grose on