Files
bun.sh/bench/snippets/async-overhead.mjs
Jarred Sumner af5c4dedca Update WebKit (#1165)
* Update WebKit

* Fix `DataView` and non-8 bit sized typed arrays with TextDecoder

* New WebKit

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-08-27 23:46:05 -07:00

19 lines
541 B
JavaScript

import { bench, run } from "../node_modules/mitata/src/cli.mjs";
bench("noop", function () {});
bench("async function(){}", async function () {});
bench("await 1", async function () {
return await 1;
});
bench("await new Promise(resolve => resolve())", async function () {
await new Promise((resolve) => resolve());
});
bench(
"Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))",
async function () {
return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1)));
}
);
await run();