Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0
Browser:
Chrome 139
Operating system:
Windows
Device Platform:
Desktop
Date tested:
8 months ago
Test name
Executions per second
Promise Chain
2058270.9 Ops/sec
Async Await
4223077.0 Ops/sec
Promise.all
893140.2 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()