bind vs closure (v54)

Revision 54 of this benchmark created on


Preparation HTML

<script>
var obj = {
  foo: function(){
    this.toString();
  }
};
var preBound = obj.foo.bind(obj);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
closure
var func = function(){ obj.foo() };
func();
ready
preBound()
preBound();
ready
skip1
throw new Error('skip')
ready
skip2
throw new Error('skip')
ready
bind()
var func = obj.foo.bind(obj);
func();
ready

Revisions

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