images

JavaScript performance comparison

Test case created

Preparation code

<canvas id="mycanvas" width=1000px height=700px>
</canvas>
<script type="txt/javascript>
var calculator = 0;
var otherCalculator = 0;
function draw()
{
try
{
ctx.clearRect(0,0,canvas.width,canvas.height);
ctx.drawImage(imag,0,0,canvas.width,canvas.height);
calculator++;
if(calculator > 10)
{
calculator = 0;
if(otherCalculator == 0)
{
imag.src = " http://newevolutiondesigns.com/images/freebies/hd-wallpaper-preview-3.jpg ";
otherCalculator =1;
}
else  if(otherCalculator == 1)
{
imag.src = "http://newevolutiondesigns.com/images/freebies/hd-wallpaper-preview-6.jpg ";
otherCalculator =2;
}
else
{
imag.src = "http://newevolutiondesigns.com/images/freebies/hd-wallpaper-preview-1.jpg ";
otherCalculator =0;
}
}
}
catch(e)
{
message = e;
}
}
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
var imag = new Image;
imag.src = "http://newevolutiondesigns.com/images/freebies/hd-wallpaper-preview-1.jpg ";
setInterval(draw,1000);
</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
loop
already
pending…
fas
already
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