image-vs-text (v8)

Revision 8 of this benchmark created on


Preparation HTML

<canvas id="src" width="120" height="30"></canvas>
<canvas id="dest" width="120" height="30"></canvas>

<script>
var src = document.getElementById('src');
var ctx = src.getContext('2d');
ctx.font = '16px Verdana';
ctx.fillText('Hello, world', 10, 24);
var srcImageData = ctx.getImageData(0, 0, 120, 30);

var dest = document.getElementById('dest');
ctx = dest.getContext('2d');
ctx.font = '16px Verdana';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
text
ctx.clearRect(0, 0, 120, 30);
ctx.fillText('Hello, world', 10, 24);
ready
image from element
ctx.clearRect(0, 0, 120, 30);
ctx.drawImage(src, 0, 0);
ready
image from data
ctx.clearRect(0, 0, 120, 30);
ctx.putImageData(srcImageData, 0, 0);
ready

Revisions

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