ramda _zip perf improvement

Benchmark created on


Setup

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

function next(a, b) {
  var len = Math.min(a.length, b.length);
  var rv = Array(len);
  var idx = 0;
  while (idx < len) {
    rv[idx] = [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(arr1, arr2);
ready
Next
next(arr1, arr2);
ready

Revisions

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