aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-06-18 10:47:42 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-18 10:47:42 -0700
commitfdb7940c4e435a5b7f5a368f4168d748baf6b5b6 (patch)
treeee23b0ee654cb7ff9307ccc1db961fed444e01f6 /bench/snippets
parent873f615358b78f913b3f8fe6adda47da7e6e57ac (diff)
downloadbun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.gz
bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.tar.zst
bun-fdb7940c4e435a5b7f5a368f4168d748baf6b5b6.zip
Fix a bunch of bugs (#3352)
* Fix a bunch of bugs * undo that one * Fix crash in readdir() * woops * woops * Add comment * :scissors: * Make `readlink()` and `realpath` use much less memory * Update BunString.cpp * woopsie * Unnecessary * Don't commit these --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'bench/snippets')
-rw-r--r--bench/snippets/realpath.mjs8
1 files changed, 7 insertions, 1 deletions
diff --git a/bench/snippets/realpath.mjs b/bench/snippets/realpath.mjs
index 9c3793d80..4793ee3d6 100644
--- a/bench/snippets/realpath.mjs
+++ b/bench/snippets/realpath.mjs
@@ -1,4 +1,10 @@
import { realpathSync } from "node:fs";
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
const arg = process.argv[process.argv.length - 1];
-for (let i = 0; i < count; i++) realpathSync(arg);
+import { bench, run } from "./runner.mjs";
+
+bench("realpathSync x " + count, () => {
+ for (let i = 0; i < count; i++) realpathSync(arg, "utf-8");
+});
+
+await run();