canvas drawing

JavaScript performance comparison

Revision 2 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext("2d");
    canvas.width = 640;
    canvas.height = 480;
   
    var fullImage = new Image();
    fullImage.src = "http://warp.povusers.org/pics/GlowTest.jpg";
    fullImage.width = 640;
    fullImage.height = 480;
   
    var overImage = new Image();
    overImage.src = "http://www.sikhnet.com/thegallery/gallery/d/355-2/20060526DuskAtHarimandirSahib-1024x768.jpg";
    overImage.width = 1024;
    overImage.height = 768;
   
    var quarterImage = new Image();
    quarterImage.src="http://www.kespia.com/pictures/Test_Drive_Unlimited_320x240.jpg";
    overImage.width = 320;
    overImage.height = 240;
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
overImage
ctx.drawImage(overImage, 0, 0, 640, 480);
pending…
fullImage
ctx.drawImage(fullImage, 0, 0, 640, 480);
pending…
tiled
ctx.drawImage(quarterImage, 0, 0, 320, 240);
ctx.drawImage(quarterImage, 320, 0, 320, 240);
ctx.drawImage(quarterImage, 0, 240, 320, 240);
ctx.drawImage(quarterImage, 320, 240, 320, 240);
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