Skip to content

Compiled Router #156

@pi0

Description

@pi0

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:

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions