How to use func-comparator - 7 common examples

To help you get started, we’ve selected a few func-comparator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github suguru03 / neo-async / perf / func-comparator / collections / sample.eachLimit.js View on Github external
var iterator = function(n, callback) {
  callback();
};
var funcs = {
  'async': function(callback) {
    async.eachLimit(array, 4, iterator, callback);
  },
  'neo-async_v0': function(callback) {
    neo_async_v0.eachLimit(array, 4, iterator, callback);
  },
  'neo-async_v1': function(callback) {
    neo_async_v1.eachLimit(array, 4, iterator, callback);
  }
};

comparator
  .set(funcs)
  .async()
  .times(times)
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / collections / sample.each.js View on Github external
var iterator = function(n, callback) {
  callback();
};
var funcs = {
  'async': function(callback) {
    async.each(array, iterator, callback);
  },
  'neo-async_v0': function(callback) {
    neo_async_v0.each(array, iterator, callback);
  },
  'neo-async_v1': function(callback) {
    neo_async_v1.each(array, iterator, callback);
  }
};

comparator
  .set(funcs)
  .async()
  .times(times)
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / collections / sample.detectSeries.js View on Github external
callback(null, res);
    });
  },
  'neo-async_v0': function(callback) {
    neo_async_v0.detectSeries(array, iterator, function(res) {
      callback(null, res);
    });
  },
  'neo-async_v1': function(callback) {
    neo_async_v1.detectSeries(array, iterator, function(res) {
      callback(null, res);
    });
  }
};

comparator
  .set(funcs)
  .async()
  .times(times)
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / controlFlow / sample.times.js View on Github external
done(null, n);
};

var funcs = {
  'async': function(callback) {
    async.times(count, iterator, callback);
  },
  'neo-async_v0': function(callback) {
    neo_async_v0.times(count, iterator, callback);
  },
  'neo-async_v1': function(callback) {
    neo_async_v1.times(count, iterator, callback);
  }
};

comparator
  .set(funcs)
  .async()
  .times(times)
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / collections / sample.sortBy.js View on Github external
var iterator = function(n, callback) {
  callback(null, n);
};
var funcs = {
  'async': function(callback) {
    async.sortBy(array, iterator, callback);
  },
  'neo-async_v0': function(callback) {
    neo_async_v0.sortBy(array, iterator, callback);
  },
  'neo-async_v1': function(callback) {
    neo_async_v1.sortBy(array, iterator, callback);
  }
};

comparator
  .set(funcs)
  .async()
  .times(times)
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / collections / sample.mapSeries.js View on Github external
var funcs = {
  'async': function(callback) {
    c = 0;
    async.mapSeries(array, iterator, callback);
  },
  'neo-async_v0': function(callback) {
    c = 0;
    neo_async_v0.mapSeries(array, iterator, callback);
  },
  'neo-async_v1': function(callback) {
    c = 0;
    neo_async_v1.mapSeries(array, iterator, callback);
  }
};

comparator
  .set(funcs)
  .option({
    async: true,
    times: times
  })
  .start()
  .result(function(err, res) {
    console.log(res);
  });
github suguru03 / neo-async / perf / func-comparator / collections / sample.filterSeries.js View on Github external
},
  'neo-async_v0': function(callback) {
    c = 0;
    neo_async_v0.filterSeries(array, iterator, function(res) {
      callback(null, res);
    });
  },
  'neo-async_v1': function(callback) {
    c = 0;
    neo_async_v1.filterSeries(array, iterator, function(res) {
      callback(null, res);
    });
  }
};

comparator
  .set(funcs)
  .option({
    async: true,
    times: times
  })
  .start()
  .result(function(err, res) {
    console.log(res);
  });

func-comparator

func-comparator is intended functions speed comparison

Unknown
Latest version published 8 years ago

Package Health Score

36 / 100
Full package analysis

Popular func-comparator functions