Creating vs. cloning images

Benchmark created on


Preparation HTML

<img src="http://upload.wikimedia.org/wikipedia/commons/e/e3/Application_xp_terminal.png" id="test-icon" />
<script>
  var testIcon = document.getElementById('test-icon');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Cloning
var newIcon = testIcon.cloneNode(false);
ready
Creating
var newIcon = new Image();
newIcon.src = "http://upload.wikimedia.org/wikipedia/commons/e/e3/Application_xp_terminal.png";
newIcon.id = "test-icon";
ready

Revisions

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