Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
promise vs callback vs async
(version: 0)
Benchmark.js
Comparing performance of:
async vs callback vs promise
Created:
2 years ago
by:
Guest
Go to the latest result
Tests:
async
async function getData() { return new Promise((resolve, reject) => { setTimeout(() => { const data = 'Some data'; resolve(data); }, 0); }); } async function main() { const data = await getData(); console.log(data); } main();
callback
function getData(callback) { setTimeout(() => { const data = 'Some data'; callback(data); }, 0); } getData((data) => { console.log(data); });
promise
function getData() { return new Promise((resolve, reject) => { setTimeout(() => { const data = 'Some data'; resolve(data); }, 0); }); } getData().then((data) => { console.log(data)})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
async
callback
promise
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 26_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/140.0.7339.122 Mobile/15E148 Safari/604.1
Browser/OS:
Chrome Mobile iOS 140 on iOS 26.0.1
View result in a separate tab
Embed
Embed Benchmark Result
callback
1.5M/s
promise
1.2M/s
async
1.0M/s
View exact numbers
Test name
Executions per second
✓
callback
1,514,425 Ops/sec
promise
1,197,629 Ops/sec
async
1,027,205 Ops/sec
Related benchmarks
promise vs callback
just promise vs just callback
Promise vs async vs callbacks
callbacks vs promises vs async/awaits
Async vs Callback
Comments
Confirm delete:
Do you really want to delete benchmark?