Wrapped async/await vs. passing on a promise

Benchmark created on


Setup

let wrappedIdx = 0;
let bareIdx = 0;

async function wrappedAsyncAwait() {
	return await Promise.resolve(wrappedIdx++);
}


function barePromise() {
	return Promise.resolve(bareIdx++);
}

function runner(cb) {
	cb()
}

Test runner

Ready to run.

Testing in
TestOps/sec
Wrapped Async/Await
runner(async () => { await wrappedAsyncAwait(); });
ready
Bare Promises
runner(async () => { await barePromise(); });
ready

Revisions

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