image-vs-text

JavaScript performance comparison

Revision 7 of this test case created by geraldalewis

Preparation code

<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 dest = document.getElementById('dest');
ctx = dest.getContext('2d');
ctx.font = '16px Verdana';
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
text
ctx.clearRect(0, 0, 120, 30);
ctx.fillText('Hello, world', 10, 24);
pending…
image
ctx.clearRect(0, 0, 120, 30);
ctx.drawImage(src, 0, 0);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment