dotvvm
dotvvm copied to clipboard
Optimize routing for larger route tables.
Large route tables can be surprisingly costy :(. It can especialy hurt if you are loading lot of resources not handled by dotvvm and all the routes have to fail before the request is forwarded to next middleware. It is slow mainly because we use regular expressions to match them and .NET's implementation of them is damn slow. The routing system is quite powerful and I don't want to end up writing custom text matcher. Maybe there already is better implementation, maybe Antlr... For quick fix it should help to extract required prefix for each route and first if the url starts with that string.