Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Promise vs Async Await
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Async Await
8.8M/s
Promise Chain
3.6M/s
Promise.all
1.8M/s
View exact numbers
Test name
Executions per second
✓
Async Await
8,790,777 Ops/sec
Promise Chain
3,581,125 Ops/sec
Promise.all
1,771,161 Ops/sec
Script Preparation code:
function executePromises() { let vals = []; Promise.resolve(1) .then(val => { vals.push(val); return Promise.resolve(2); }) .then(val => { vals.push(val); return Promise.resolve(3); }) .then(val => { vals.push(val); return Promise.resolve(4); }) .then(val => { vals.push(val); return Promise.resolve(5); }) .then(val => { vals.push(val); return Promise.resolve(6); }) .then(val => { vals.push(val); console.log(vals); }); } async function executeAwaits() { const val = await Promise.resolve(1); const val2 = await Promise.resolve(2); const val3 = await Promise.resolve(3); const val4 = await Promise.resolve(4); const val5 = await Promise.resolve(5); const val6 = await Promise.resolve(6); const vals = [val, val2, val3, val4, val5, val6]; console.log(vals); } function executePromiseAll(){ Promise.all([ Promise.resolve(1), Promise.resolve(2), Promise.resolve(3), Promise.resolve(4), Promise.resolve(5), Promise.resolve(6) ]).then((vals, rej) => { console.log(vals); }); }
Tests:
Promise Chain
executePromises();
Async Await
executeAwaits();
Promise.all
executePromiseAll()