Skip to content
Map/Reduce/Filter/Find Vs For loop Vs For each Vs Lodash vs Ramda
Branch: master
Clone or download
dg92 Merge pull request #6 from stmcallister/master
fixing typos in formulas.js
Latest commit 3cf7746 May 29, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore lodash and heavy data added May 10, 2018
data.js data file empty May 10, 2018
generate_data.js formulas: sanity/ removed invalid operations May 12, 2018
small_data_set_result.png result image added May 11, 2018
test_large_data_set.js lodash added May 10, 2018


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.

To run

  1. Run npm install
  2. 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.
  3. For a small data set performance report run npm run t:s.
    • This runs the analysis on the first 5 elements of the array.
  4. 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.

Results for small data set of array size 5 - 1000


Results for mid data set of array size 3000 - 20000


Results for large data set of array size 50000 - 1000000


Coming Soon

  1. Ramda.js test
  2. Caching (inline, warm) considerations
  3. GC considerations


  1. These results are computed using Node V8 v5.8.283.41
  2. These result does not consider the JIT, inline caching, hidden classes, deoptimizations, garbage collection, pretenuring etc.
  3. Result may vary as per env's.
  4. Red colour highlight in the above images is just for reference, will soon change.


You can’t perform that action at this time.