Andrus
Andrus

Reputation: 27955

How to profile aspx view

Controller code:

public ActionResult Index()        {
var start = DateTime.Now;
var view = View(new DetailViewModel());
// var view = new ContentResult() { Content = "Done" };
var endTime = DateTime.Now - start;
return view;

It takes 0.5 seconds to return page to browser in localhost in fast laptop and 4 seconds in production server with Mono/Apache in virtual server. endTime value is very small. It looks like delay occurs after return view statement.

If view is replaced with

var view = new ContentResult() { Content = "Done" };

page is rendered immediately.

aspx file associated with view refers to Site.Master nad contains code which calls several business methods and some partial views.

How to find the code which causes this slowness ?

Using Visual Web Developer 2010 Express, C#, MVC2

Andrus.

Upvotes: 0

Views: 135

Answers (1)

HatSoft
HatSoft

Reputation: 11201

you can use profiler's avaialble in the market

I prefer JetBrains Dot Trace

JetBrains Dot Trace Memory & Performance profiler http://www.jetbrains.com/profiler/

Red Gate's Ants Profiler

Scitech's Memory Profiler

Ms CLR Profiler

Upvotes: 1

Related Questions