tags:

views:

103

answers:

4

Hi All

For Example You know foreach loop is heavy And if we use for loop is Better.

What Tools Can Help me to Write Code With Best Performance In C Sharp net,And Check My Code for this?

Please Help me

Edit ::

I Want A Tools To Convert my Code To Best Performance Code.For Example When I Compile My C Sharp Code To IL Code,This Tools Convert foreach loop to for loop For Best Performance.

+1  A: 

Keyword: Profiler. A profiler executes your code and helps you discovering performance-lacks by measuring.

Best one for .NET is: http://www.jetbrains.com/profiler/index.html?dt30pr

Microsoft also has a program to analize your .NET assemblies (not by measuring) but by reflecting in order to detect performancecosting coding habits (e.g. defining more than 64 variables in a method block):

http://msdn.microsoft.com/en-us/library/bb429476%28VS.80%29.aspx

Steav
+2  A: 

Redgate's performance profiler is a great tool for this, which has a free 14-day trial.

Jetbrain's profiler is also very good.

PatrickJ
these are both good tools, worth paying for
Mark
+1  A: 

The tool you need is called Profiler. I like dotTrace Profiler (Google it). btw, foreach loop is not heavy it self.

Andrey
+2  A: 

The best tool for performance optimization is a good profiler. The profiler will show you what parts of your code take the longest to execute. You can then focus your efforts where they will do the most good. Visual Studio 2010 (I think Professional and up) has a very good profiler in the box. I also like Red-Gate ANT profiler and JetBrain's dotTrace.

Tom Cabanski