Benchmarks

Light Validation

Performance benchmarks for an Update Simple User endpoint with Lightweight validation and serialization.

These benchmarks are based on the Fastify benchmarks repo. Our goal is to perform similarly to Fastify as we consider it the industry standard in terms of performance.

Update Simple User benchmark involves heavy only light validation and serialization on top of routing.

What is tested?

The test consists of an updateSimpleUser request with a simple User model (~100 bytes payload) that includes:

interface SimpleUser {
  id: number;
  name: string;
  surname: string;
  lastUpdate: Date;
}

// ### mion ###
// the received user by the route is already validated and deserialized
// all Date fields are already JS Date objects (not strings from JSON.parse)
export const routes: Routes = {
  updateUser: (ctx, user: SimpleUser): SimpleUser => {
    user.lastUpdate = new Date();
    return user;
  },
};

// ### Other frameworks (Express, Fastify, Hono, etc.) ###
// Use Zod schemas for validation and date coercion
const UserSchema = z.object({
  id: z.number(),
  name: z.string(),
  surname: z.string(),
  lastUpdate: z.coerce.date(),
});

app.post("/updateUser", function (req, res) {
  const user = UserSchema.parse(req.body); // Validates + deserializes dates
  user.lastUpdate = new Date();
  res.json(user);
});

Notes

We can observe how in this benchmark the requests take considerably more time compared with the 'hello world' benchmark. This is mostly because each request is spending extra time on validation and serialization.

For this specific test, the performance of the libraries used for validation and serialization might be more important than the routing itself.


Benchmarks

  • Machine: darwin arm64 | 12 vCPUs | 16.0GB Mem
  • Node: v24.13.0
  • Run: Fri Feb 27 2026 01:09:42 GMT+0000 (Greenwich Mean Time)
  • Method: autocannon -c 100 -d 20.1 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)

Req (R/s)

Throughput (Mb/s)

Latency (ms)

Max Memory (Mb)

Memory Series (MB)

Results Table

VersionRouterReq (R/s)Latency (ms)Output (Mb/s)Max Memory (Mb)Max Cpu (%)ValidationDescription
http-node16.18.071516.813.5417.93145108bare node http server with Zod validation
mion.bun0.6.270662.413.7217.246698mion using bun, automatic validation and serialization
hono.bun3.12.669801.613.9313.377294hono bun server with Zod validation
elysia.bun1.0.069360.014.0213.299194Elysia framework with TypeBox validation
mion0.6.263504.015.2418.34157110Automatic validation and serialization out of the box
fastify5.7.446017.621.2311.58311134Fastify with native JSON Schema validation
express5.2.145132.821.6511.32176117Express with Zod validation
hapi21.4.441270.423.7210.35266112Hapi with Zod validation
hono3.12.633037.629.747.811117135hono node server with Zod validation
Benchmarks Repo