213123123901230291

JavaScript performance comparison

Test case created

Preparation code

<script>
var obj = {
    getValue: function()  { return 3; }
}

function optEnabled( obj ) {
    return obj.getValue() + obj.getValue() + obj.getValue();
}

function optDisabled( obj ) {
    try{}catch(e){}
    return obj.getValue() + obj.getValue() + obj.getValue();
}

var l = 1e6; while(l--) {optEnabled(obj); optDisabled(obj);}
</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
optimizations enabled
if( optEnabled( obj ) !== 9  ){
 die();
}
pending…
optimizations disabled
if( optDisabled( obj ) !== 9  ){
 die();
}
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment