From a9e4ff2029a769737982fcf7e0b7d76d35cf35e4 Mon Sep 17 00:00:00 2001 From: evan Date: Tue, 12 Jul 2022 04:40:12 -0400 Subject: cleanup benchmarks folder (#587) * cleanup benchmarks * run prettier --- bench/gzip/bun.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bench/gzip/bun.js (limited to 'bench/gzip/bun.js') 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(); -- cgit v1.2.3