mirror of
https://github.com/denoland/deno.git
synced 2025-09-22 10:22:34 +00:00
![]() Fixes #28702. Super artificial benchmark: ```ts const perf = performance; async function asyncOpen() { const start = perf.now(); for (let i = 0; i < 100_000; i++) { const file = await Deno.open("./foo.txt"); file.close(); } const end = perf.now(); console.log(end - start); } function syncOpen() { const start = perf.now(); for (let i = 0; i < 100_000; i++) { const file = Deno.openSync("./foo.txt"); file.close(); } const end = perf.now(); console.log(end - start); } if (Deno.args[0]?.trim() === "async") { await asyncOpen(); } else { syncOpen(); } ``` Results (average of 10 for each): ``` deno sync 1785.59 deno-this-pr sync 491.69 deno async 1839.71 deno-this-pr async 528.78 ``` --------- Co-authored-by: David Sherret <dsherret@users.noreply.github.com> |
||
---|---|---|
.. | ||
mod.rs | ||
permission_checker.rs |