-
-
Notifications
You must be signed in to change notification settings - Fork 34
Compiled Router #156
Copy link
Copy link
Closed
1 / 11 of 1 issue completedLabels
enhancementNew feature or requestNew feature or request
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Docs
Compiling the router into a static function can improve runtime performance even further (~2-3 times)
Compilation can be done either at runtime (JIT) or when building (AOT) as a string (see snapshots to see how it looks like).
JIT (just-in-time) has (little) overhead of bundle size (for code gen) and requires eval support in runtime which is not always possible (for example cloudflare workers although AFAIK, there is plan to support, JIT is always likely to be limited) but is also easiest way to use this feature and leverage runtime performances!
Another possibility is AoT (ahead-of-time) compilation. In this mode, we serialize the router into a runnable JavaScript code.
Roadmap:
findRoute#158 by @aquapi 🚀compileRouterToString#159)Use faster hashmaps for static lookup