ramda zipWith perf update

Benchmark created on


Setup

function current(fn, a, b) {
  var rv = [];
  var idx = 0;
  var len = Math.min(a.length, b.length);
  while (idx < len) {
    rv[idx] = fn(a[idx], b[idx]);
    idx += 1;
  }
  return rv;
}

function next(fn, a, b) {
  var len = Math.min(a.length, b.length);
  var rv = Array(len);
  var idx = 0;
  while (idx < len) {
    rv[idx] = fn(a[idx], b[idx]);
    idx += 1;
  }
  return rv;
}

const arr1 = Array(10000).fill(undefined).map((_, i) => i);

const arr2 = Array(10000).fill(undefined).map((_, i) => i);

Test runner

Ready to run.

Testing in
TestOps/sec
Current
current((a, b) => ([a, b]), arr1, arr2)
ready
Next
next((a, b) => ([a, b]), arr1, arr2)
ready

Revisions

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