views:

107

answers:

5

Possible Duplicate:
Any Good Free .NET Profiler?

I am currently developping a control that is supposed to draw a heatmap in realtime at about 20Hz. This consumes an awful lot of CPU resources and I would like to know which function calls are slowing it down that much, sine I got the impression that I am already using a fairly efficient algorithm (only redrawing areas that changed, not instantiating any new GDI related objects unless needed, cleaning up after myself using Dispose(), etc...) So any recommendations concerning a profiler that fulfills said conditions or concerning further optimizations of my algorithm would be welcome.

EDIT: I used the EQATEQ profiler and found out that it made no difference whether I changed Graphics.Clip. Turns out that one has to declare a new Region object, modify that, and then call Graphics.Clip = myNewRegionObjet instead of directly modifying Graphics.Clip. This is very weird, as typically a reference should be passed, and therefore making changed to the object should be no problem!? The weird behaviour is described here: http://msdn.microsoft.com/en-us/library/system.drawing.graphics.clip.aspx I changed my control accordingly, which resulted in a more than tenfold speedup. Now its fast enough. :-) Has anybody got any idea why the Graphics.Clip property does exhibit that weird behaviour?

A: 

FxCop from Microsoft is free and, I think, not that difficult; for more information see: http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx and for examples see here: http://www.nikhilk.net/Ajax-FxCop.aspx

riffnl
In what sense is FxCop a profiler?
Rob Levine
FXCop is not a profiler, it's a code analyser which helps you enforce coding standards.
Mark B
FxCop merely checks that code conforms to the MS design guidelines, it is not a code profiler...
Longball27
+1  A: 

May be you should try Visual Studio Profiler

for VS2008 and here is a useful articles
Find Application Bottlenecks with Visual Studio Profiler
Code performance analysis in Visual Studio 2008

Sandy
it's only within the TFS edition but not in Express nor in Professional
Oliver
+4  A: 

Many of the full profilers have time-limited trial products with full functionality. If you only need it for a few weeks, I'd look into something like dotTrace from JetBrains.

In fact, dotTrace 4.0 is still in beta, and I have a feeling that as long as it is still in beta, you can keep downloading it and get a longer "trial" period than with the official product, although obviously it may have a few beta issues.

Rob Levine
I'll second (4th?) dotTrace - awesome bit of kit, feels like a redgate product.
annakata
A: 

Hmm... i think profilers were noted enough :-) but do you use WPF? thats much more performant than windows forms. specially when you have a lot of objects rendering on the surface.

cRichter
I am using windows forms.
meanandvicious
then try to switch. at least for this control.my performance of drawing hit the roof, when i switched just for my object intensive controls.
cRichter
+1  A: 

There are free trial versions of many profilers.

ANTS is easy to use AQTime has more features EQATech - have not used

Andrew P