Coder Social home page Coder Social logo

performance-analysis-js's Introduction

Performance-Analysis

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

small_data_set_result

Results for mid data set of array size 3000 - 20000

mid_data_set_result

Results for large data set of array size 50000 - 1000000

large_data_set_result

Coming Soon

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

Note

  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.

Discussion/Posts

  1. https://news.ycombinator.com/item?id=17050798
  2. https://medium.com/@ideepak.jsd/javascript-performance-test-for-vs-for-each-vs-map-reduce-filter-find-32c1113f19d7

performance-analysis-js's People

Contributors

dg92 avatar stmcallister avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.