From ced69d38180e963da1206f9932db76666cec9f72 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 14 Sep 2023 21:26:37 -0700 Subject: async-ify all node:fs functions (#5360) * async all node:fs functions * draw the rest of the owl * LLVM & Clang 16 --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- bench/snippets/write.node.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bench/snippets/write.node.mjs') diff --git a/bench/snippets/write.node.mjs b/bench/snippets/write.node.mjs index 14bceb23f..f59c98aef 100644 --- a/bench/snippets/write.node.mjs +++ b/bench/snippets/write.node.mjs @@ -9,9 +9,8 @@ bench("writeFile(/tmp/foo.txt, short string)", async () => { await writeFile("/tmp/foo.txt", "short string", "utf8"); }); -const buffer = Buffer.from("short string"); bench("writeFile(/tmp/foo.txt, Buffer.from(short string))", async () => { - await writeFile("/tmp/foo.txt", buffer); + await writeFile("/tmp/foo.txt", Buffer.from("short string")); }); const fd = openSync("/tmp/foo.txt", "w"); @@ -22,7 +21,7 @@ bench("write(fd, short string)", () => { }); bench("write(fd, Uint8Array(short string))", () => { - const bytesWritten = write(fd, buffer); + const bytesWritten = write(fd, Buffer.from("short string")); if (bytesWritten !== 12) throw new Error("wrote !== 12"); }); -- cgit v1.2.3