Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
async for vs promise.all2
(version: 0)
Comparing performance of:
asyncFor vs asyncPromiseAll
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
async function asyncFor(){ for (const x of [1, 2, 3]) { await new Promise(resolve => setTimeout(resolve(x > 0), 100)); } } async function asyncPromiseAll() { await Promise.all([1, 2, 3].map(x => new Promise(resolve => setTimeout(resolve(x > 0), 100)) )); }
Tests:
asyncFor
asyncFor()
asyncPromiseAll
asyncPromiseAll()
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
asyncFor
asyncPromiseAll
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Browser/OS:
Chrome 108 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
asyncFor
28403.0 Ops/sec
asyncPromiseAll
9846.3 Ops/sec
Related benchmarks:
for vs foreach vs map vs for..of
For loop map vs map builtin for 100000 elements
for vs foreach vs map 2
Performance of JavaScript .forEach, .map and .reduce vs for and for..of (fork)
Array loop vs foreach vs map forsk
Comments
Confirm delete:
Do you really want to delete benchmark?