import { Buffer } from "node:buffer"; import { writeFile } from "node:fs/promises"; import { bench, run } from "mitata"; var hugeFile = Buffer.alloc(1024 * 1024 * 64); var medFile = Buffer.alloc(1024 * 1024 * 16); var humongousFile = Buffer.alloc(1024 * 1024 * 256); bench( `fs.writeFile ${new Intl.NumberFormat("en-US", { style: "unit", unit: "megabyte", unitDisplay: "narrow", }).format(humongousFile.byteLength / 1024 / 1024)}`, async () => { await writeFile("/tmp/bun.bench-out.humongousFile.txt" + ((Math.random() * 65432) | 0).toString(16), humongousFile); }, ); bench( `fs.writeFile ${new Intl.NumberFormat("en-US", { style: "unit", unit: "megabyte", unitDisplay: "narrow", }).format(hugeFile.byteLength / 1024 / 1024)}`, async () => { await writeFile("/tmp/bun.bench-out.huge.txt" + ((Math.random() * 65432) | 0).toString(16), hugeFile); }, ); bench( `fs.writeFile ${new Intl.NumberFormat("en-US", { style: "unit", unit: "megabyte", unitDisplay: "narrow", }).format(medFile.byteLength / 1024 / 1024)}`, async () => { await writeFile("/tmp/bun.bench-out.medium.txt" + ((Math.random() * 65432) | 0).toString(16), medFile); }, ); await run(); value='ciro/child-process-fixes'>ciro/child-process-fixes Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/inspect.test.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-12[bun.js] Implement Bun.sha1, Bun.sha256, Bun.sha384, Bun.sha512, Bun.sha512_384Gravatar Jarred Sumner 11-70/+601
2022-04-12add depth limit to .gitmodules (#142)Gravatar evan 1-0/+9
2022-04-12maybe this fixes it?Gravatar Jarred Sumner 2-15/+9
2022-04-12Make sendfile more reliableGravatar Jarred Sumner 8-197/+122
2022-04-12wip fixes to sendfile() blockingGravatar Jarred Sumner 7-84/+185