canvas-vs-image

Benchmark created by Simon on


Description

Don't run until you see at least one kitten!

Preparation HTML

<canvas id="canvas1" width="100" height="100"></canvas>
<canvas id="canvas2" width="100" height="100"></canvas>

<script>

var can = document.getElementById('canvas1');
var ctx = can.getContext('2d');

var can2 = document.getElementById('canvas2');
var ctx2 = can2.getContext('2d');

var img = new Image();
img.src = 'http://placekitten.com/100/100';
img.onload = function() {
  ctx2.drawImage(img, 0, 0);
}

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
draw image
ctx.drawImage(img, 0, 0);
ready
draw canvas
ctx.drawImage(can2, 0, 0);
ready

Revisions

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