-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
1 / 11 of 1 issue completedLabels
enhancementNew feature or requestNew feature or request
Description
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:
- Experimental JIT support in feat: experimental compiler (3x faster matcher!) #155, feat(compiler): complete functionality to match
findRoute
#158 by @aquapi 🚀- unnamed placeholders
- fallback to dynamic
- trailing slash
- wildcard lookups
- mixed params in same segment (RegExp, low priority)
- Experimental Serialized support (feat(compiler):
compileRouterToString
#159) - Improve performance
- Deduplicate static checks
-
Use faster hashmaps for static lookup - Reshaping tree in compiler (Method => Route)
zsilbi, productdevbook, unnoq, bryan-hoang, aquapi and 2 moreKai-ros, johannschopplich, productdevbook and sadeghbarati
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request