Area
Routing
Problem Statement
Have you considered using sanic-routing? It has extremely high performance and more importantly it gives routes correct priority and lookup (much unlike FastAPI). It uses O(1) lookup for static routes, then tree lookup for dynamic routes. The trick is it writes Python functions with a set of if-elses at route finalization time (application startup) avoiding any runtime logic to traverse the tree, while still working in plain Python.
Static routes having a higher priority and route lookup being global (rather than ordering and subapp based) of course mean it is no longer directly compatible with FastAPI. Therefore I cannot see FastAPI ever switching to this otherwise far superior system, but presumably FasterAPI just might.
Proposed Solution
Use sanic-routing. It is a separate package of Sanic precisely to allow it being used in other projects.
API Design (if applicable)
Alternatives Considered
No response
Would you be willing to submit a PR?
Yes, with guidance
Area
Routing
Problem Statement
Have you considered using sanic-routing? It has extremely high performance and more importantly it gives routes correct priority and lookup (much unlike FastAPI). It uses O(1) lookup for static routes, then tree lookup for dynamic routes. The trick is it writes Python functions with a set of if-elses at route finalization time (application startup) avoiding any runtime logic to traverse the tree, while still working in plain Python.
Static routes having a higher priority and route lookup being global (rather than ordering and subapp based) of course mean it is no longer directly compatible with FastAPI. Therefore I cannot see FastAPI ever switching to this otherwise far superior system, but presumably FasterAPI just might.
Proposed Solution
Use sanic-routing. It is a separate package of Sanic precisely to allow it being used in other projects.
API Design (if applicable)
Alternatives Considered
No response
Would you be willing to submit a PR?
Yes, with guidance