ASP.NET Application Running Slow
There's a web app I've been assigned to, which is running very slow. It is a site that sells products so it is database driven, however even p开发者_运维问答ages that do not query the database are loading very slow. The pages use master pages, and the code is in VB.NET
I checked with fiddler and the time it takes to load basic (non database driven) pages are about 5.5 seconds on average.
What are some tools that can help me determine the cause of the slow speeds, and any recommendations as to how to speed it up, or potential issues that could cause it?
Update
So I messed around with the code piece by piece as I wasn't getting anywhere with these tools. As soon as I remove master pages, and I include the same code that's on the master pages in the .aspx page itself, the speed improves drastically (approximately 5 times faster load times).
What might cause the master pages to cause load times to slow down so much?
If it's mainly front-end performance issues you can always check out Steve Souder's rules on how to improve that. At least it can look faster to the user.
If you do use Firebug, there is a plugin for it that incorporates these rules - YSlow which is quite useful.
The ANTS Performance Profiler can conduct code-level timings to see where most of the time is spent. You can also use Response.Write()
and time each method to do this manually.
You don't need to mess around with Response.Write()
to get a breakdown of method timing: simply add the Trace="true"
attribute to a page's @Page
directive as described here: http://msdn.microsoft.com/en-us/library/94c55d08.aspx
That will give you a breakdown of the time elapsed in each event of the page's lifecycle.
If you need finer measurement within an event (e.g. all the time is in Page_Load()
and that does a bunch of different things), you can add Trace.Write()
calls like this:
Trace.Write("category name", "your message");
Put a few of those throughout a long-running method and you can see which step is taking the time.
You can use firebug for firefox, I believe it's available for a few browsers. You can see all of the files that are being received, how much time each one takes and the file size.
精彩评论