test-speed-obj

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
   
    function OBJ_1( obj ){
        return obj.x;
    }
   
    obj1 = {
        x: 10
    }
   
    function OBJ_2(){}
   
    OBJ_2.prototype.getX = function(){
        return this.x;
    }
   
    obj2 = new OBJ_2();
    sum = 0;
};
</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
functional
sum += OBJ_1( obj1 );
pending…
class object
sum += obj2.getX();
   
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