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 (Linux; Android 14; Mobile; rv:127.0) Gecko/127.0 Firefox/127.0
Browser:
Firefox Mobile 127
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
Promise Chain
105349.7 Ops/sec
Async Await
156437.0 Ops/sec
Promise.all
21420.6 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()