{"id":13722761,"url":"https://github.com/SaltyAom/bun-http-framework-benchmark","last_synced_at":"2025-05-07T16:30:46.414Z","repository":{"id":58865767,"uuid":"524697082","full_name":"SaltyAom/bun-http-framework-benchmark","owner":"SaltyAom","description":"Compare throughput benchmark from various Bun HTTP framework","archived":false,"fork":false,"pushed_at":"2025-05-06T13:58:37.000Z","size":1920,"stargazers_count":466,"open_issues_count":19,"forks_count":41,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-06T15:05:44.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SaltyAom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-08-14T14:39:50.000Z","updated_at":"2025-05-06T13:58:41.000Z","dependencies_parsed_at":"2023-02-17T05:01:15.785Z","dependency_job_id":"8129bdd0-666b-451e-99aa-ea8759b8da0a","html_url":"https://github.com/SaltyAom/bun-http-framework-benchmark","commit_stats":{"total_commits":190,"total_committers":22,"mean_commits":8.636363636363637,"dds":0.631578947368421,"last_synced_commit":"8d1d01059997fd6532c93b2edef402ed3720c6bc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaltyAom%2Fbun-http-framework-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaltyAom%2Fbun-http-framework-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaltyAom%2Fbun-http-framework-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaltyAom%2Fbun-http-framework-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaltyAom","download_url":"https://codeload.github.com/SaltyAom/bun-http-framework-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915206,"owners_count":21824520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:32.626Z","updated_at":"2025-05-07T16:30:46.383Z","avatar_url":"https://github.com/SaltyAom.png","language":"TypeScript","readme":"# Bun HTTP Framework Benchmark\n\nCompare throughput benchmarks from various JavaScript HTTP framework\n\nTest method: Average throughput\n\n1. Ping\n    - Request to [GET] `/`\n    - Return `hi`\n    - Headers must contains text `Content-Type: text/plain`, additional context is acceptable eg. `Content-Type: text/plain; charset=utf-8`\n2. Query\n    - Request to [GET] `/id/:id`\n    - Extract path parameter, query string and setting headers.\n    - For this benchmark, the request URL will be send as: `/id/1?name=bun`\n    - Headers must contains `x-powered-by` to `benchmark`\n    - Expected response: **\"1 bun\"** (`${id} ${query}`)\n        - You **MUST NOT use hardcode string or index** to extract querystring.\n        - In a real-world situation, there's no enforcement that the request will follow the specification, using hardcode index to extract `name=bun` querystring will be prone to error.\n        - To test if it pass the requirement, the implementation should be able to extract querystring **dynamically** (please treat the value of 'name=bun' can be any value beside 'bun', for example 'alice', 'hina'), which means that the same code should be able to extract querystring, for example:\n        - `/id/1?name=bun\u0026id=1` -\u003e should return `1 bun` not `1 bun\u0026id=1`\n        - `/id/1?id=1` -\u003e should return `1 `\n        - Query beside `name` maybe not need to be extracted and is optional\n    - Headers must contains text `Content-Type: text/plain`, additional context is acceptable eg. `Content-Type: text/plain; charset=utf-8`\n3. Body\n    - [POST] `/json`\n    - Mirror body to response\n    - Server **MUST parse body to JSON and serialize back to string**\n    - For the benchmark, the request body will be sent as: `{ \"hello\": \"world\" }`\n    - Expected response: `{ \"hello\": \"world\" }`\n    - Headers must contains text `Content-Type: application/json`, additional context is acceptable eg. `Content-Type: application/json; charset=utf-8`.\n\n## requirement\n\n-   The framework must at-least has latest published in less than 9 month otherwise will be classified as unmaintained and removed unless is an industry standard (Express).\n\n# Prerequistes\n\n-   [bombardier](https://github.com/codesenberg/bombardier)\n-   Nodejs\n-   Deno\n-   Bun\n\n# Run Test\n\n```typescript\nbun benchmark\n```\n\nDump result will be available at `results/[benchmark-name].txt`\n\n## Benchmark Condition\n\nThis benchmark is tested under the following condition:\n\n-   Intel I7-13700K, DDR5 32GB 5600MHz\n-   Arch Linux 6.10.9-arch1-2 (btw I use Arch)\n-   Bun 1.2.11\n-   Node 22.15.0\n-   Deno 2.2.0\n\nTested on 6 May 2025 20:55 (GMT+7)\n\n## Results\n\nThese results are measured in req/s:\n\n|  Framework       | Runtime | Average | Ping       | Query      | Body       |\n| ---------------- | ------- | ------- | ---------- | ---------- | ---------- |\n| uws | node | 526,295.397 | 535,079.45 | 509,759.27 | 534,047.47 |\n| ultimate-express | node | 416,645.31 | 526,907.98 | 508,436.34 | 214,591.61 |\n| elysia | bun | 397,259.163 | 533,560.05 | 300,716.41 | 357,501.03 |\n| bun | bun | 366,716.193 | 386,961.93 | 317,958.96 | 395,227.69 |\n| hyper-express | node | 315,844.147 | 370,809.65 | 299,522.59 | 277,200.2 |\n| bun-web-standard | bun | 303,568.81 | 338,462.84 | 255,297.65 | 316,945.94 |\n| nhttp | bun | 283,734.777 | 373,377.37 | 244,767.65 | 233,059.31 |               | wobe | bun | 282,858.987 | 282,509.03 | 250,687.47 | 315,380.46 |\n| hono | bun | 253,646.173 | 294,945.14 | 236,066.25 | 229,927.13 |\n| deno | deno | 247,770.227 | 269,520.16 | 233,460.27 | 240,330.25 |\n| nbit | bun | 229,226.153 | 252,902.81 | 196,843.1 | 237,932.55 |\n| deno-web-standard | deno | 204,908.633 | 236,235.96 | 183,458.05 | 195,031.89 |\n| hono | deno | 201,548.523 | 250,592.98 | 195,744.04 | 158,308.55 |\n| fastify | node | 142,695.487 | 155,142.07 | 148,078.23 | 124,866.16 |\n| hono | node | 129,234.593 | 144,842.92 | 134,412.44 | 108,448.42 |\n| express | bun | 126,674.41 | 145,427.54 | 134,805.54 | 99,790.15 |\n| oak | bun | 120,481.7 | 117,743.45 | 109,295.56 | 134,406.09 |\n| h3 | bun | 109,739.16 | 132,720.75 | 104,854.13 | 91,642.6 |\n| h3 | node | 101,237.803 | 136,023.12 | 111,361.83 | 56,328.46 |\n| oak | deno | 100,205.983 | 105,824.67 | 93,335 | 101,458.28 |                    | koa | node | 96,456.887 | 103,217.62 | 97,582.12 | 88,570.92 |\n| acorn | deno | 64,951.337 | 95,734.91 | 71,099.63 | 28,019.47 |\n| express | node | 25,079.01 | 26,286.22 | 24,796.49 | 24,154.32 |\n\nSee more detail in [results](https://github.com/SaltyAom/bun-http-framework-benchmark/tree/main/results)\n\n## Notice\n\nI highly recommended testing this benchmark on your machine yourself as performance in likely to vary between machine.\n\nIf you are unable to run Deno, please run each Deno app individually first until the Deno finish installing the package, then proceed to run benchmark using `bench.sh` or `npm run benchmark`\n","funding_links":[],"categories":["Community","TypeScript"],"sub_categories":["Adapters"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaltyAom%2Fbun-http-framework-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSaltyAom%2Fbun-http-framework-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSaltyAom%2Fbun-http-framework-benchmark/lists"}