I am trying to optimize my ASP.NET MVC application using some techniques that include URL generation tweaking a la: http://www.chadmoran.com/blog/2009/4/23/optimizing-url-generation-in-aspnet-mvc-part-2.html
If the speed difference is so large between using RouteValueDictionary in place of anonymous classes, then should I also look to use Dictionary in place of anonymous classes when defining html attributes?
For example, should I do this:
Html.ActionLink("LinkName", "Action", "Controller",
new RouteValueDictionary { { "id", Model.Id } },
new { @class = "someCSSClass" })
or should I further optimize by doing this:
Html.ActionLink("LinkName", "Action", "Controller",
new RouteValueDictionary { { "id", Model.Id } },
new Dictionary<string, object> { { "class", "someCSSClass" } })
I know it's even faster to use Url.Action, or better yet to use the RouteLink technique, but I'm just wondering whether anonymous classes should be completely avoided for the sake of speed.