render-vs-prerender

JavaScript performance comparison

Revision 96 of this test case created by Luca

Preparation code

<img id="scream" src="http://www.w3schools.com/html/img_the_scream.jpg" alt="The Scream" width="220" height="277">

<img id="logo" src="http://www.w3schools.com/images/w3logotest2.png" alt="The Logo" width="100" height="50">


<canvas id="canvas1" width="220" height="277"></canvas>
<script>
  var can = document.getElementById('canvas1');
  var ctx = can.getContext('2d');
  
  var can2 = document.createElement('canvas');
  can2.width = 220;
  can2.height = 227;
  var ctx2 = can2.getContext('2d');
  
   var img = document.getElementById("scream");
   var img2 = document.getElementById("logo");
    
</script>
    

Preparation code output

<img id="scream" src="http://www.w3schools.com/html/img_the_scream.jpg" alt="The Scream" width="220" height="277"> <img id="logo" src="http://www.w3schools.com/images/w3logotest2.png" alt="The Logo" width="100" height="50"> <canvas id="canvas1" width="220" height="277"></canvas>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
render
ctx.drawImage(img,0,0);
ctx.drawImage(img2,0,0);
pending…
pre-rendered

ctx2.drawImage(img,0,0);
ctx2.drawImage(img2,0,0);
ctx.drawImage(can2, 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.

0 Comments

The Scream