Improve route matching (raw) performance
redbar0n opened this issue · comments
Describe the feature
Hono uses a faster RegExpRouter instead of a Radix Tree based router such as Radix3 which H3 currently uses.
Additional information
- Would you be willing to help implement this feature?
I appreciate your concern about performance and suggestions.
I invite you to check the radix3 benchmarks and see if the raw matcher responsiveness of 7M ops (on a single core of laptop) is less than of your real world usage expectations that might need an alternative method.
There is also an off-topic discussion in unjs/rou3#58 which I will respond in the future.
Generally regarding performances please consider the main bottleneck in any real world server application is not the core or route matcher but user logic and the composition of utilities in which h3 tries to best at.
We can make small adjustments to radix3 to increase benchmark results for specific route conditions but it is just much lower priority comparing to priorities such as ecosystem compatibility.
Also made unjs/rou3#85 as tracker let's move discussion there.
(if you still believe there are strong reasons h3 usage would significantly be different by opting to a different router, we can definitely come back to this 👍🏼 )
But @medley/router algorithm is still the fastest as of rn, not their implementation though