bound vs saved context (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script>
function MyClass() {
  this.a = 0;
}

var my_class_inst = new MyClass(),
    bound = function() {
        this.a = this.a + 1;
    }.bind(my_class_inst),
    context = function() {
        my_class_inst.a = my_class_inst.a + 1;
    },
    funct = function(elem)
    {
        elem.a = elem.a + 1;
    };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
bind
bound();
ready
saved context
context();
ready
function
funct(my_class_inst);
ready

Revisions

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