Promises vs sync

Benchmark created on


Setup

const arr = new Array(1000).fill('crap');

function syncFunc() { return 'foo' };

async function asyncFunc() { return 'foo' };

Test runner

Ready to run.

Testing in
TestOps/sec
Sync
const results = arr.map(() => syncFunc());
ready
Async
const promises = arr.map(() => asyncFunc());

Promise.all(promises).then((results) => {}).catch(() => {});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.