https://github.com/shaikrasheed99/javascript-iterations-performance-test
Performance test of JavaScript iterations
https://github.com/shaikrasheed99/javascript-iterations-performance-test
array-methods iterations javascript javascript-array-methods javascript-loops loops performace-testing
Last synced: 7 months ago
JSON representation
Performance test of JavaScript iterations
- Host: GitHub
- URL: https://github.com/shaikrasheed99/javascript-iterations-performance-test
- Owner: shaikrasheed99
- License: mit
- Created: 2023-02-11T15:46:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T13:12:28.000Z (over 2 years ago)
- Last Synced: 2025-01-13T19:39:09.419Z (9 months ago)
- Topics: array-methods, iterations, javascript, javascript-array-methods, javascript-loops, loops, performace-testing
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Performance test of JavaScript iterations
We have few techniques to iterate over the arrays, objects and strings.
Tested the each technique with 1 Million iterations and executed the `test.js` file for `5` times using the `for i in {1..5}; node test.js;` command.
## Results
* `While` loop - 1.4ms
* `Do while` loop - 0.8ms
* `For` loop - 0.8ms
* `For Of` loop - 9.5ms
* `For In` loop - 137ms
* `Map` method - 8.5ms
* `Filter` method - 7.2ms
* `Reduce` method - 6.4ms
* `Sort` method - 11.7ms
* `Every` method - 7.2ms
* `Some` method - 6.8ms
* `Chaining methods` - 16.3ms