Writing a fast router can be surprisingly difficult if you are trying to cover the edges. The state of the art is not trivial:
https://github.com/dotnet/aspnetcore/blob/main/src/Http/Rout...
The thing is, performance in that particular context hardly matters, unless you're forcing users to switch pages faster than 1 page per second. Even if each resolving takes 0.1 seconds (which be bad, don't get me wrong), 99% of users wouldn't notice a thing, and if you're a small agency/shop/company/team, focusing on more general things tends to be time spent better.
You're assuming that URLPattern is performant... That doesn't seem to be the case currently.
https://adventures.nodeland.dev/archive/you-should-not-use-u...
https://github.com/denoland/deno/issues/19861