array-unique icon indicating copy to clipboard operation
array-unique copied to clipboard

benchmark results

Open aretecode opened this issue 8 years ago • 0 comments
trafficstars

output from running benchmarks: (where are the numbers? how to best run them?)

 array-unique git:(master) ✗ node benchmark
#1: long
  filter:
  filter2:
  forIn:
  linearSearch01:
  setImmutable:
  set:
  whileHash:
  while:

  fastest is
#2: med
  filter:
  filter2:
  forIn:
  linearSearch01:
  setImmutable:
  set:
  whileHash:
  while:

  fastest is
#3: short
  filter:
  filter2:
  forIn:
  linearSearch01:
  setImmutable:
  set:
  whileHash:
  while:

  fastest is

added filter 2 which is:

module.exports = function(arr) {
  return arr.filter(function(value, index, arr) {
    return arr.indexOf(value) === index;
  });
};

aretecode avatar Jun 20 '17 23:06 aretecode