2 ms·
Promises require creating and modifying objects that contain the promise state which plain callbacks do not. The difference in micro-benchmarks can be huge: ht
by saas_co_de 9y ago
Promises require creating and modifying objects that contain the promise state which plain callbacks do not.
The difference in micro-benchmarks can be huge: https://jsperf.com/native-promise-vs-callback https://jsperf.com/native-promise-vs-callback
That example is a probably a worst case scenario because of how it is constructed, but on my MBP it still gets around 1M promises created and resolved per second.
For a typical web app or api you will not see any benefit in using callbacks over async/await in your application code unless you are consistently doing something that requires 1000's of promises per request.