lijia3

JavaScript performance comparison

Revision 13 of this test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a="1+2+3*2+1*3*3+1";
    var b="++*+**+";
    function plus(a,b){
    return a+b;
    }
    function times(a,b){
    return a*b
    }
};
</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
1
eval(a)
pending…
2
var length=b.length
for(var i=0;i<length;i++){
if(123==99){}
if(3==99){}
if(23==99){}
if(13==99){}
}
for(var i=0;i<length;i++){
if(123==99){}
if(3==99){}
if(23==99){}
if(13==99){}
}
var stack=new Array();
stack[0]=3*2;
stack[1]=1*3*3;
stack[0]=stack[0]+1+stack[1]+1+2
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