Skip to content

ChrisLegaxy/js-async-await-parallel-execution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JS Async-Await Parallel Execution

Testing of JS async/await loop performance with for loop await vs map await.

Description

Since for loop await is a common mistake that JS developers makes, causes major performance issues without understanding the concept of parallel execution which can be done with Promise.all().

Installation

Can copy all this and execute to clone & install

  git clone https://github.com/ChrisLegaxy/js-async-await-parallel-execution.git \
  && cd js-async-await-parallel-execution \
  && yarn

Running Tests

To run tests, run the following command

  yarn test

My Test Results

Execution Time Description
BAD_AWAIT_LOOP 4.006s MOCK TEST
GOOD_AWAIT_LOOP 1.001s MOCK TEST
BAD_AWAIT_LOOP 686.375ms REAL FETCH TEST
GOOD_AWAIT_LOOP 213.2ms REAL FETCH TEST

Credits & References

Author

Chris Legaxy/Chris Van

Contact: chris.legaxy@gmail.com | chrisvan.vshmr@gmail.com

Website: https://chrisvan.netlify.app

About

JS Async/Await Parallel Execution with Promise.all()

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published