Router Benchmark
How fast can each router match a URL to a handler and pull out parameters? This benchmark isolates just the routing layer — no HTTP, no middleware, just pure matching.
Full source code: prostojs/router-benchmark
Routers Tested
| Router | Used by | Type |
|---|---|---|
| @prostojs/router (ProstoRouter) | Wooks | Regex-based, indexed |
| find-my-way | Fastify | Radix trie |
| rou3 | h3 / Nitro | Radix trie (findRoute()) |
| rou3 (compiled) | — | rou3's JIT compiler (compileRouter() from rou3/compiler) |
| Hono SmartRouter | Hono | RegExpRouter, falls back to TrieRouter when the route set cannot be compiled |
| Express | Express | Linear scan (baseline) |
Methodology
Each router registers the same set of routes and resolves the same request mix. Every lookup performs full parameter extraction — not just matching — so routers that defer param processing get no advantage. Before measuring, all routers must return identical matches and params; each router runs in a fresh Node.js process.
The tests cover three route shapes: short paths (2–5 segments), long paths (5–10 segments), and a mixed 50/50 combination. The workload includes statics, parametric routes with up to 4 params, wildcards, multiple HTTP methods, and 404 misses.
Results are in operations per millisecond — higher is better.
Indicative estimate
Single round on a laptop: Apple M4 MacBook Air (fanless), Node.js 24.22, 1 round × 5 samples per test. Treat differences of a few percent as noise.
Overview by Route Type
Key takeaway
Compiled rou3 is the fastest router on every route shape. ProstoRouter is mid-pack: 4th on short routes, 3rd on long routes (behind find-my-way) and 4th on mixed routes, well ahead of Express everywhere.
Short Routes (22 routes)
Typical REST APIs with 2–5 segment paths.
Compiled rou3 is 2.5x ahead of the next router. Plain rou3 is second and Hono's RegExpRouter third; ProstoRouter is 3.4x behind the leader, ahead of find-my-way.
Long Routes (22 routes)
Deep, nested paths with shared prefixes and multiple parameters, such as /api/v1/orgs/:orgId/teams/:teamId/projects/:projectId/tasks/:taskId.
Compiled rou3 leads by 3.4x. find-my-way is second, 19% ahead of ProstoRouter; Hono (level with ProstoRouter) and plain rou3 follow.
Mixed Routes (20 routes)
50/50 combination of short and long routes.
Compiled rou3 and Hono's RegExpRouter are close at the top. ProstoRouter and plain rou3 are level, about 1.9x behind; find-my-way is about 10% behind them.
Long Route Breakdown
A closer look at individual long-route test patterns:
Static lookups: plain rou3 is the fastest on the short static path, compiled rou3 on the long one. ProstoRouter's static lookups (44–60k ops/ms) are several times faster than its parametric ones.
Parametric routes: compiled rou3 leads every row by a wide margin, and find-my-way is ahead of ProstoRouter at every parameter count. ProstoRouter is ahead of Hono and plain rou3 on most of these rows.
Wildcards: compiled rou3, find-my-way and Hono are ahead of ProstoRouter.
404 handling: compiled rou3 and Hono's RegExpRouter reject non-matching URIs fastest; find-my-way follows. ProstoRouter and plain rou3 are well behind them.
Scaling: 22 → 200 Routes
How throughput changes as the route table grows.
Short Routes
Long Routes
Mixed Routes
Hono switches routers as the route set grows
Hono's SmartRouter uses RegExpRouter while it can compile the route set, and TrieRouter otherwise. In this run it switched to TrieRouter from 100 long routes and at 198 mixed routes. Hono loses the most throughput on mixed routes as routes are added (13x from the smallest to the largest set); on short routes it loses 7.8x, about as much as Express (8.3x).
| Router | Scaling behavior (smallest → largest route set) |
|---|---|
| rou3 (compiled) | Fastest at every size; drops 3.7x on short routes, 1.2x on long, 1.5x on mixed |
| find-my-way | Flat on long routes; drops 2–2.3x on short and mixed |
| rou3 | Flat on long routes (6.6–6.9k); drops 3–3.7x on short and mixed |
| ProstoRouter | Drops 3.5x on short (mostly between 22 and 50 routes), 1.8x on long, 3.1x on mixed |
| Hono | 7.8x on short, 1.9x on long, 13x on mixed (the largest drop) |
| Express | Far behind at every size; drops 8.3x on short, 1.6x on long, 7.9x on mixed |
At 200 routes ProstoRouter is behind find-my-way and both rou3 variants on all three shapes, and ahead of Hono and Express.
Feature Comparison
Raw lookup speed is only part of the picture. @prostojs/router supports matching features that not every router offers:
| Feature | @prostojs/router | find-my-way | Rou3 | Hono |
|---|---|---|---|---|
| Parametric routes | ✅ | ✅ | ✅ | ✅ |
| Regex constraints on params | ✅ | ✅ | ❌ | ❌ |
| Multiple wildcards per path | ✅ | ❌ | ❌ | ❌ |
| Regex constraints on wildcards | ✅ | ❌ | ❌ | ❌ |
| Optional parameters | ✅ | ❌ | ❌ | ✅ |
| Case-insensitive matching | ✅ | ✅ | ❌ | ❌ |
| Trailing slash normalization | ✅ | ❌ | ❌ | ❌ |
| URL decoding | ✅ | ✅ | ❌ | ❌ |
| Same-name param arrays | ✅ | ❌ | ❌ | ❌ |
In a full HTTP server, routing is a small part of the per-request cost — see the HTTP framework benchmark.
Benchmark source: prostojs/router-benchmark. Results generated October 2026 (indicative estimate, single round on a laptop).