Comparing native JavaScript array methods map, reduce, filter, and find against for loop, forEach loop and lodash methods. The analysis uses basic operations and heavy data manipulation to analyze the execution speed of each method.
- Run
npm install
- Generate the data for the tests by running
npm run seed
.- The default array is 10000 elements in length. You can create an array of a custom length by passing the desired size as an arugment, like so
npm run seed 100000
.
- The default array is 10000 elements in length. You can create an array of a custom length by passing the desired size as an arugment, like so
- For a small data set performance report run
npm run t:s
.- This runs the analysis on the first 5 elements of the array.
- For a performance report on the whole array run
npm run t:l
To test your own function create them in the formulas.js file.
- Ramda.js test
- Caching (inline, warm) considerations
- GC considerations
- These results are computed using Node V8 v5.8.283.41
- These result does not consider the JIT, inline caching, hidden classes, deoptimizations, garbage collection, pretenuring etc.
- Result may vary as per env's.
- Red colour highlight in the above images is just for reference, will soon change.