arr-diff icon indicating copy to clipboard operation
arr-diff copied to clipboard

Better `filter.js` benchmark

Open ChocolateLoverRaj opened this issue 2 years ago • 0 comments

There are many things I would like to change:

  • https://github.com/jonschlinkert/arr-diff/blob/ea84b7d68a26c29bd9c8715879f6714a0986752f/benchmark/code/filter.js#L3 Uses function instead of arrow function
  • https://github.com/jonschlinkert/arr-diff/blob/ea84b7d68a26c29bd9c8715879f6714a0986752f/benchmark/code/filter.js#L3 Uses arrays for a parameter, but is actually used like const arrays =. Uses arguments, when it could use ...arrays.
  • https://github.com/jonschlinkert/arr-diff/blob/ea84b7d68a26c29bd9c8715879f6714a0986752f/benchmark/code/filter.js#L4 This is a really wierd line. Can just use [].concat() instead of [].concat.apply(). Uses [].slice when Array.prototype.slice makes more sense.
  • https://github.com/jonschlinkert/arr-diff/blob/ea84b7d68a26c29bd9c8715879f6714a0986752f/benchmark/code/filter.js#L6 Can use includes instead of indexOf

Can I make a pull request changing this? Should I add a new benchmark or edit the existing one?

ChocolateLoverRaj avatar Apr 26 '22 16:04 ChocolateLoverRaj