views:

99

answers:

4
+1  Q: 

Profiling ASP.NET

I'd like to profile sections of asp.net code to be able to objectively compare alternate approaches based on some real numbers.

A good example is: I'd like to see an instruction trace for for what happens when a repeater is rendered vs (blech - the following is NOT my idea) building markup in a concatenated string or stringbuilder and emitting to the browser. I'd also like to be able to demonstrate how concatenating strings that grow to 100kB+ effectively requires memory in the amount of double the string length every time you add a character or string to the end.

Are there any such tools available?

Update

There are a couple of good replies here, but nothing that answers the question if how to get an instruction trace.

+3  A: 

red-gate has a profile and memory profiler for .NET. I've only trialled them, but they seemed very good and may give you what you want.

MikeW
A: 

I've never heard of anything that's going to give you an instruction trace, per se. All a profiler does is tell you which code takes longest to execute.

John Saunders
+1  A: 

If existing profilers don't do what you're looking for, you could always use the Stopwatch class, which can provide sub-millisecond accuracy on most systems.

RickNZ
+1  A: 

Microsoft has a memory profiler (download: http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a-94635beebdda&displaylang=en).

Here are some instructions on how to use it: http://msdn.microsoft.com/en-us/library/ms979205.aspx

You'll notice the screenshots in the instructions do a good job at providing detail regarding the specific question (string concatenation vs. string builder) you were trying to draw a conclusion on.

Kyle B.