diff options
author | 2022-11-23 07:14:33 -0800 | |
---|---|---|
committer | 2022-11-23 07:14:33 -0800 | |
commit | ac36ea51cfb85130403ac09299f8e1207bad4bcb (patch) | |
tree | a05bc2d34295bc0087b68b799155f18050451721 /bench/snippets | |
parent | ae3fcb5bd89a4ac908ba6d4cdb1be4e7c7f0ea81 (diff) | |
download | bun-ac36ea51cfb85130403ac09299f8e1207bad4bcb.tar.gz bun-ac36ea51cfb85130403ac09299f8e1207bad4bcb.tar.zst bun-ac36ea51cfb85130403ac09299f8e1207bad4bcb.zip |
possibly more reliable Bun.spawn (#1547)
* wip
* wip
* Fix bug with stdin
* zig fmt
* seems to work!
* Update streams.test.js
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'bench/snippets')
-rw-r--r-- | bench/snippets/headers.mjs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/bench/snippets/headers.mjs b/bench/snippets/headers.mjs index ace0d9f00..948b3f21b 100644 --- a/bench/snippets/headers.mjs +++ b/bench/snippets/headers.mjs @@ -1,13 +1,14 @@ import { bench, run } from "../node_modules/mitata/src/cli.mjs"; // pure JS implementation will optimze this out -bench("new Headers", function () { - return new Headers(); -}); +// bench("new Headers", function () { +// return new Headers(); +// }); var big = new Headers({ "Content-Type": "text/plain", "Content-Length": "123", + hello: "there", "X-Custom-Header": "Hello World", "X-Another-Custom-Header": "Hello World", "X-Yet-Another-Custom-ader": "Hello World", @@ -16,25 +17,29 @@ var big = new Headers({ "X-Yet-Another-Custom-Headz": "Hello Worlda", }); -bench("Header.get", function () { - return big.get("Content-Type"); -}); +// bench("Header.get", function () { +// return big.get("Content-Type"); +// }); -bench("Header.set (standard)", function () { - return big.set("Content-Type", "text/html"); -}); +// bench("Header.set (standard)", function () { +// return big.set("Content-Type", "text/html"); +// }); -bench("Header.set (non-standard)", function () { - return big.set("X-My-Custom", "text/html123"); -}); +// bench("Header.set (non-standard)", function () { +// return big.set("X-My-Custom", "text/html123"); +// }); if (big.toJSON) - bench("Header.toJSON", function () { + bench("Headers.toJSON", function () { return big.toJSON(); }); -bench("Header fromEntries", function () { +bench("Object.fromEntries(headers.entries())", function () { return Object.fromEntries(big.entries()); }); +bench("Object.fromEntries(headers)", function () { + return Object.fromEntries(big); +}); + run(); |