Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize Bun implementation, add Mapl and remove Byte #84

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Mapl
aquapi committed Nov 30, 2024
commit 2975f9900fb8b2c300e53c94b7aaf9bc26c38bab
Binary file modified bun.lockb
Binary file not shown.
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"name": "bun-http-framework-benchmark",
"scripts": {
"benchmark": "bun bench.ts",
"kill-port": "kill-port 3000",
"ts-node": "ts-node"
},
"devDependencies": {
"@hono/node-server": "^1.12.0",
"@types/bun": "^1.1.6",
"@types/express": "^4.17.21",
"@types/kill-port": "^2.0.3",
"@types/koa": "^2.15.0",
"@types/koa-bodyparser": "^4.3.12",
"@types/koa-router": "^7.4.8"
},
"dependencies": {
"@bit-js/byte": "^1.6.1",
"@elysiajs/fn": "^0.6.1",
"@hapi/hapi": "^21.3.10",
"@nbit/bun": "^0.13.4",
"@nestjs/common": "^10.3.10",
"@nestjs/core": "^10.3.10",
"@nestjs/platform-express": "^10.3.10",
"@oakserver/oak": "^14.1.0",
"bunrest": "^1.3.8",
"elysia": "1.1.18",
"express": "^4.19.2",
"fastify": "^4.28.1",
"h3": "^1.12.0",
"hono": "^4.5.3",
"hyper-express": "^6.16.4",
"kill-port": "^2.0.1",
"koa": "^2.15.3",
"koa-bodyparser": "^4.4.1",
"koa-router": "^12.0.1",
"nhttp-land": "^1.3.26",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"ultimate-express": "^1.2.5",
"vixeny": "^0.1.47",
"wobe": "^1.1.7"
},
"module": "index.ts",
"peerDependencies": {
"typescript": "^5.0.0"
}
"name": "bun-http-framework-benchmark",
"scripts": {
"benchmark": "bun bench.ts",
"kill-port": "kill-port 3000",
"ts-node": "ts-node"
},
"devDependencies": {
"@hono/node-server": "^1.12.0",
"@types/bun": "^1.1.6",
"@types/express": "^4.17.21",
"@types/kill-port": "^2.0.3",
"@types/koa": "^2.15.0",
"@types/koa-bodyparser": "^4.3.12",
"@types/koa-router": "^7.4.8"
},
"dependencies": {
"@elysiajs/fn": "^0.6.1",
"@hapi/hapi": "^21.3.10",
"@mapl/app": "^0.1.6",
"@nbit/bun": "^0.13.4",
"@nestjs/common": "^10.3.10",
"@nestjs/core": "^10.3.10",
"@nestjs/platform-express": "^10.3.10",
"@oakserver/oak": "^14.1.0",
"bunrest": "^1.3.8",
"elysia": "1.1.18",
"express": "^4.19.2",
"fastify": "^4.28.1",
"h3": "^1.12.0",
"hono": "^4.5.3",
"hyper-express": "^6.16.4",
"kill-port": "^2.0.1",
"koa": "^2.15.3",
"koa-bodyparser": "^4.4.1",
"koa-router": "^12.0.1",
"nhttp-land": "^1.3.26",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"ultimate-express": "^1.2.5",
"vixeny": "^0.1.47",
"wobe": "^1.1.7"
},
"module": "index.ts",
"peerDependencies": {
"typescript": "^5.0.0"
}
}
16 changes: 16 additions & 0 deletions src/bun/mapl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { router, jitc } from '@mapl/app';

const id = router()
.headers({ 'x-powered-by': 'benchmark' })
.get('/:id', (c) => `${c.params[0]} ${new URL(c.req.url).searchParams.get('name')}`)

const app = router()
.build('/', () => 'Hi')
.post('/json', {
type: 'json',
fn: async (c) => c.req.json()
})
.route('/id', id);

export default
await jitc(app, { exposeStatic: true });