Adia for design 'Too many endpoint' for Hono #2957
Replies: 2 comments
-
OR Is the performance impact minimal since the definition of routes by this code is usually done only once at application startup? |
Beta Was this translation helpful? Give feedback.
-
Short answerThe code you have shown will not degrade performance. Long answerHaving more endpoints does not degrade performance compared to other routers. I have confirmed no performance degradation with a few hundred or so endpoints. Due to the optimization process during startup, it also performs very well when a large number of middleware is combined. As an internal implementation, if there is no path parameter, as in your example, it is looked up from the object. This case is very fast. {
'/hello' => handler,.
'/en/hello' => handler,.
'/en/hello' => handler,.
}[requestPath] |
Beta Was this translation helpful? Give feedback.
-
Does the following code neutralize Hono's characteristic RegExp search process?
Beta Was this translation helpful? Give feedback.
All reactions