ASP.NET MVC Performance Issues with Render Partial
We were working on optimization effort for a web application that we built recently. After we finished fixing up Select N+1, Caching and other NHibernate related ORM usage issues another thing popped out. Our profiler was actually showing a hot spot on loading partial views, System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String, Object).
After doing some research I found this article by Kazi Manzur Rashid. I recommend reading it,http://weblogs.asp.net/rashid/archive/2009/04/23/asp-net-mvc-view-location-and-performance-issue.aspx
foreach (var viewEngine in ViewEngines.Engines.OfType<VirtualPathProviderViewEngine>())
{ viewEngine.ViewLocationCache = } Another solution will be to put the full path of the ascx file on RenderPartial instead of just the name.
This is only a problem when running in debug mode. In release mode the paths to the locations are cached.