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: one month ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Chrome 108 on Windows
View result in a separate tab
Test name Executions per second
asyncFor 19950.9 Ops/sec
asyncPromiseAll 732.8 Ops/sec