function accessor

JavaScript performance comparison

Test case created by pk

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var Obj = function(){
    this.property = "hello";
    }
    Obj.prototype.accessor = function(){ return this.property }
   
    var test_obj = new 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
property
var k = test_obj.property;
pending…
function
var k = test_obj.accessor();
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