Script Preparation code:
x
 
function emptyTimeout(ms) {
    return new Promise((resolve, reject) =>
        setTimeout(() => resolve(), ms));
}
async function asyncFor() {
  for (let i = 50; i < 500; i += 50) {
    await emptyTimeout(i);
  }
}
async function asyncPromiseAll() {
  const promises = [];
  for (let i = 50; i < 500; i += 50) {
    promises.push(emptyTimeout(i));
  }
  await Promise.all(promises);
}
Tests:
  • asyncFor

     
    asyncFor()
  • asyncPromiseAll

     
    asyncPromiseAll()
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    asyncFor
    asyncPromiseAll

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 OPR/79.0.4143.50
Opera 79 on Windows
View result in a separate tab
Test name Executions per second
asyncFor 296886.7 Ops/sec
asyncPromiseAll 35007.5 Ops/sec