Bun: Elysia.js vs Hono — Hello world
In this article, I’m going to compare two of the fastest web frameworks available on Bun: Elysia.js and Hono. Let’s see who’s turns out to be faster. Also, I’ll look at the resource usage (CPU and memory).
Test setup
The tests are executed on MacBook Pro M1 with 16G of RAM. Bun v0.5.9 is the latest at the time of writing.
The hello world app code is:
Elysia.js
import { Elysia } from "elysia";
const app = new Elysia();
app.get("/", () => "Hello World!");
app.listen(3000);
Hono
import { Hono } from "hono";
const app = new Hono();
app.get("/", (c) => c.text("Hello World!"));
export default app;
The code is almost the same.
Results
Each test is executed for 10M (10 million) requests. The tests are executed for 25, 100, and 300 concurrent connections. The load test is carried out using Bombardier HTTP testing tool. A warm-up of 1000 requests is given before taking readings.
The results are as follows:
Analysis
Elysia is marginally faster than Hono, but the winning margin is negligible.
WINNER: Both