canvas-vs-image
JavaScript performance comparison
Info
Don't run until you see at least one kitten!
Preparation code
<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>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
draw image |
|
pending… |
draw canvas |
|
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:
- Revision 1: published by Simon
- Revision 2: published by Simon
- Revision 3: published
0 comments