ramda-auto-curry-cost (v8)

Revision 8 of this benchmark created by buzz on


Preparation HTML

<script src="https://rawgit.com/CrossEye/ramda/13c176720b72fd4610aa4fdc354396c0c43d2187/ramda.js"></script>
<script>var ramdaOld = ramda;</script>
<script src="https://rawgit.com/CrossEye/ramda/9ed5b16d849066e7ccb000099c6eb731e295f4a7/ramda.js"></script>
<script src="https://rawgit.com/lodash/lodash/30cddd09343b1eaf4e4f0905476636607822dde5/dist/lodash.js"></script>

Setup

var f = function(prop, obj) { 
    return obj === undefined ? function(obj) { return obj[prop]; } : obj[prop]; 
  };
  
  var g = function(prop, obj) { 
    return arguments.length < 2 ? function(obj) { return obj[prop]; } : obj[prop]; 
  };
  
  var g2 = function(prop, obj) { 
    return arguments.length === 0 ? g2 :
      arguments.length < 2 ? function(obj) { return obj[prop]; } : 
        obj[prop]; 
  };
  
  var r1 = ramdaOld.get('foo'),
      r2 = ramda.get('foo'),
      l = _.property('foo'),
      manual = f('foo'),
      manual2 = g('foo'),
      manual3 = g2('foo');
  
  var object = { 'foo': true };

Test runner

Ready to run.

Testing in
TestOps/sec
manual w/ arg.length check
manual2(object);
ready
manual guard vs. no args
manual3(object);
ready
ramda.get (new)
r2(object);
ready
manual
manual(object);
ready
ramda.get (old)
r1(object);
ready
_.property
l(object);
ready

Revisions

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