Skip to content

perf(vovk): match routes with params through a tree - #135

Merged
finom merged 1 commit into
mainfrom
perf/route-tree
Oct 22, 2026
Merged

finom merged 1 commit into
mainfrom
perf/route-tree

Conversation

@finom

@finom finom commented Oct 22, 2026

Copy link
Copy Markdown
Owner

A new path with a param, or a path with no route, no longer checks every route of the method: routes with params are matched one segment at a time in a tree per segment and method. The per-path route cache is gone.

At 100,000 endpoints (perf/, lowest median of 5 runs, Node 24.21, M4 Pro): new path with a param 10.5 ms → 2.5 µs, path with no route 26 ms → 3.0 µs. A repeated path with a param is about 0.1 µs slower than its cache hit was (main vs branch, alternating runs). Cold start unchanged.

Conflicts, duplicate params, %2F inside a segment, HEAD and 405 work as before; route-matching.test.ts covers them and the scaling.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
realtime-kanban Ready Ready Preview Oct 22, 2026 10:55am UTC
vovk-agent-ready Ready Ready Preview Oct 22, 2026 10:55am UTC
vovk-examples Ready Ready Preview Oct 22, 2026 10:55am UTC
vovk-hello-world Ready Ready Preview Oct 22, 2026 10:55am UTC
vovk-multitenant-example Ready Ready Preview Oct 22, 2026 10:55am UTC

Request Review

This branch was successfully deployed

4 active deployments
Preview – vovk-multitenant-example — 6ef923e6 Deployed Oct 22, 2026 by vercel[bot]
Preview – realtime-kanban — 6ef923e6 Deployed Oct 22, 2026 by vercel[bot]
Preview – vovk-examples — 6ef923e6 Deployed Oct 22, 2026 by vercel[bot]
Preview – vovk-hello-world — 6ef923e6 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant