mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
* Make file uploads fast * Add benchmark * Update README.md * defaults * print * prettier * smaller * fix(path) fix parse behavior (#3134) * Add macro docs (#3139) * Add macro doc * Updates * Tweaks * Update doc * Update macro serialization doc * Update macro doc * `--no-macros` flag, disable macros in node_modules * invert base/filename internally (#3141) * always false * Fix broken test * Add a test sendfile() test with large file --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com> Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
36 lines
475 B
Markdown
36 lines
475 B
Markdown
# HTTP request file upload benchmark
|
|
|
|
This is a simple benchmark of uploading a file to a web server in different runtimes.
|
|
|
|
## Usage
|
|
|
|
Generate a file to upload (default is `hello.txt`):
|
|
|
|
```bash
|
|
bun generate-file.js
|
|
```
|
|
|
|
Run the server:
|
|
|
|
```bash
|
|
node server-node.mjs
|
|
```
|
|
|
|
Run the benchmark in bun:
|
|
|
|
```bash
|
|
bun stream-file-bun.js
|
|
```
|
|
|
|
Run the benchmark in node:
|
|
|
|
```bash
|
|
node stream-file-node.mjs
|
|
```
|
|
|
|
Run the benchmark in deno:
|
|
|
|
```bash
|
|
deno run -A stream-file-deno.js
|
|
```
|