curry-cost (v8)

Revision 8 of this benchmark created on


Preparation HTML

<script src="https://cdn.rawgit.com/ramda/ramda/v0.10.0/dist/ramda.min.js"></script>
<script src="https://cdn.rawgit.com/lodash/lodash/3.5.0/lodash.min.js"></script>
<script src="https://jspm.io/system@0.14.js"></script>
<script>
System.import('npm:lodash-fp').then(function(lodashfp) {
  fp = lodashfp;
  R.customUniq = R.curryN(2, R.flip(R.nAry(2, _.uniq)));
  document.getElementById('run').style.display = '';
});

document.getElementById('run').style.display = 'none';
</script>

Setup

var objects = _.times(500, function(i) { return { 'a': i }; }),
      array = _.shuffle(objects.concat(objects));

Test runner

Ready to run.

Testing in
TestOps/sec
R.uniqWith
var r = R.uniqWith(function(x, y) { return x.a == y.a; }, array);
ready
R.uniqWith curried
var r = R.uniqWith(function(x, y) { return x.a == y.a; })(array);
ready
R.customUniq
var r = R.customUniq('a', array);
ready
R.customUniq curried
var r = R.customUniq('a')(array);
ready
fp.uniqBy
var r = fp.uniqBy('a', array);
ready
fp.uniqBy curried
var r = fp.uniqBy('a')(array);
ready

Revisions

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