Focus on framework features.
Example code for benchmark.
// GET /
framework.get("/", (req, res) => {
res.send("home");
});
// GET /blog/99?title=bench (params and queryParams)
framework.get("/blog/:id", (req, res) => {
const data = `${req.params.id} ${req.query.title}`;
res.send(data);
});
// GET /api/user (set header & send json)
framework.get("/api/user", (req, res) => {
res.setHeader("x-powered-by", "bench");
res.json({ user: "john" });
});
Created At : Thu Mar 13 2025, 12:53:27 AM
Created By : bot_ci
Name | AVG | GET / | GET /blog/:id | GET /api/user |
---|---|---|---|---|
hono | 58345 | 61511 | 61451 | 52074 |
nhttp | 56883 | 59562 | 58400 | 52688 |
fast | 53460 | 62842 | 47757 | 49782 |
oak | 27281 | 27489 | 26610 | 27745 |
Name | AVG | GET / | GET /blog/:id | GET /api/user |
---|---|---|---|---|
nhttp | 39255 | 45893 | 37139 | 34732 |
fastify | 25111 | 27331 | 24726 | 23276 |
koa | 17307 | 18764 | 16252 | 16904 |
express | 6928 | 7030 | 6552 | 7203 |
Name | AVG | GET / | GET /blog/:id | GET /api/user |
---|---|---|---|---|
elysia | 70948 | 79887 | 70358 | 62598 |
hono | 62295 | 71622 | 61432 | 53830 |
nhttp | 61576 | 83487 | 53627 | 47614 |
baojs | 43980 | 48052 | 40270 | 43617 |
git clone https://github.com/herudi/deno_benchmark.git
cd deno_benchmark
// for_all
deno task bench
// for_single
deno task bench framework_name