Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance of ASP.NET MVC routing

Does anyone know, is routing processing time valuable in a comparison with the total request time? Will there be a large performance difference between an application with 20 and 100 (probably more) routings? Will be grateful for a link with the routings mechanism description.

like image 206
Daniil Grudzinskiy Avatar asked Jun 24 '11 08:06

Daniil Grudzinskiy


1 Answers

Take a look here. Please note that this is an old answer from 2008, but I would guess it still holds true. In particular note the bit about using named routes.

In other words, if you know which route you will be using, then you can jump straight to the correct route with code like this: RedirectToRoute("routeName", viewData);and it won't waste time trawling through routes until it finds the correct one. This may seem a bit cumbersome, but it's better than hardcoding the routes as, if you change the way of generating your routes, this code will still work, whereas a hard coded route would break.

like image 61
Tom Chantler Avatar answered Nov 15 '22 12:11

Tom Chantler