ctx-flip-performance

JavaScript performance comparison

Test case created by Simon

Info

Don't run the test until you see a kitten below (so that we know the image is loaded)

Preparation code

<canvas id="canvas1" width="500" height="500"></canvas>
<script>
var can = document.getElementById('canvas1');
var ctx = can.getContext('2d');


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


</script>
<script>
Benchmark.prototype.setup = function() {
    can.width = can.width;
};
</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
flip
ctx.save();
ctx.scale(-1, 1);
ctx.drawImage(img, -200, 0);
ctx.restore();
pending…
drawing an image
ctx.drawImage(img, 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