bind vs curry

Benchmark created by Michal Svrček on


Setup

function addCurry(a) {
    return function(b) {
      return a + b;
    }
  }
  
  function addBind(a, b) {
    return a + b;
  }

Test runner

Ready to run.

Testing in
TestOps/sec
curry
var addOne = addCurry(1);
addOne(2)
ready
bind
var addOne = addBind.bind(this, 1);
addOne(2)
ready

Revisions

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

  • Revision 1: published by Michal Svrček on