lijia3

JavaScript performance comparison

Revision 11 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
for(var i=0;i<b.length;i++){
if(123==99){}
if(3==99){}
if(23==99){}
if(13==99){}
}
for(var i=0;i<b.length;i++){
if(123==99){}
if(3==99){}
if(23==99){}
if(13==99){}
}
plus(1,plus(2,plus(times(3,2),plus(times(1,times(3,3)),1))))
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