aboutsummaryrefslogtreecommitdiff
path: root/bench/gzip/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'bench/gzip/bun.js')
-rw-r--r--bench/gzip/bun.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/bench/gzip/bun.js b/bench/gzip/bun.js
new file mode 100644
index 000000000..1c5cdcadd
--- /dev/null
+++ b/bench/gzip/bun.js
@@ -0,0 +1,20 @@
+import { run, bench } from "mitata";
+import { gzipSync, gunzipSync } from "bun";
+
+const data = new TextEncoder().encode("Hello World!".repeat(9999));
+
+const compressed = gzipSync(data);
+
+bench(`roundtrip - "Hello World!".repeat(9999))`, () => {
+ gunzipSync(gzipSync(data));
+});
+
+bench(`gzipSync("Hello World!".repeat(9999)))`, () => {
+ gzipSync(data);
+});
+
+bench(`gunzipSync("Hello World!".repeat(9999)))`, () => {
+ gunzipSync(compressed);
+});
+
+await run();