aspnetmvc-403773-troubleshooting-performance-issues-how-to-improve-view-rendering-speed.md
This topic complements the How to: Improve page rendering speed topic and contains information specific to DevExpress ASP.NET MVC Extensions.
DevExpress ASP.NET MVC project templates register styles and scripts for all available suites. This reduce the View render speed.
@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
...
new StyleSheet { ExtensionSuite = ExtensionSuite.TreeList }
)
@Html.DevExpress().GetScripts(
new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
...
new Script { ExtensionSuite = ExtensionSuite.TreeList }
)
Do any of the following to resolve the issue:
Exclude the links to resources for unused suites.
Include styles and scripts in specific Views only.
When the total request/response cycle duration is too long, use the following technique to diagnose the issue:
Use the System.Diagnostics.Stopwatch object to measure a Controller/Model’s elapsed time:
public ActionResult MeasuredActionMethod() {
System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
// Execute your operations here
sw.Stop();
ViewData["Duration"] = sw.ElapsedMilliseconds.ToString();
return View();
}
@ViewData["Duration"]