views:

307

answers:

8
+3  Q: 

What is profiling?

I am new to this and is trying to learn,

What is profiling?

What are various free tools for profiling .NET, JEE

Can java script be profiled if so by which tool and lastly how do these profilers work?

+2  A: 

profiling is measuring the execution times and correlating it with various classes/methods/functions. (see the link I gave to the wikipedia page for some commentary on how profilers can work)

Jason S
+6  A: 

Profiling measures how long various parts of the code take to run. Javascript can be profiled with firebug: http://getfirebug.com/js.html

dickeytk
+1 for mentioning firebug and explaining profiling.
Ramesh
+2  A: 

There is a great answer in my question: How is profiling different from logging?

Brian R. Bondy
+1  A: 

The way you would usually use your profiler is as follows:

  1. Start the profiler, fire up your application using the profiler.
  2. Use your application for some time or just the features in your application that you have identified as bottlenecks and would like to optimize.
  3. Once your application is closed (or sometimes even before that), the profiler can present you a breakdown of execution times per function. Some will also allow you to get a breakdown of execution times per line or function within one of these functions so you can see where cpu most time was used up using a top-down approach.
  4. Usually some functions in your application will take an unusually long time to execute. After looking at your profiling results, you should be able to identify them and eliminate performance problems.
Adrian Grigore
+1  A: 

Think of profilers as debuggers for execution duration bugs.

Profilers are implemented a lot like debuggers too, except that rather than allowing you to stop the program and poke around, they simply let it run and keep track of how much time gets spent in every part of the program. This is particularly useful if you have some code that is running slower than you need it to run, as you can figure out exactly where all the time is going, and concentrate your efforts on fixing just that bottleneck.

Many developers believe you should never hand-optimize code without using a profiler.

T.E.D.
+1 for explaining how profilers work
Ramesh
+2  A: 

Here are some .NET profilers for you to try (free):

I am not a big fan of these. I would recommend one of the commercial products to get the best results:

Other than that take a look at Brad Adams blog posts Profilers for the CLR and .NET Application Profiler.

I personally like dotTrace.

David Pokluda
+1 for listing some good profilers.
Ramesh
A: 

Wikipedia says:

In software engineering, performance analysis, more commonly today known as profiling, is the investigation of a program's behavior using information gathered as the program executes

Continue reading here http://en.wikipedia.org/wiki/Performance_analysis.

So, about javascript tool Firebug(http://getfirebug.com/index.html#install) is an excelent option.

Agusti-N
It drives me crazy that performance analysis and use of profilers are considered the same thing - or rather, that measurement of performance and diagnosis of performance are considered the same thing.
Mike Dunlavey
A: 

Profiling is a technique for measuring execution times and numbers of invocations of procedures.

It is not however the only or even necessarily the best way to locate things that cause time to be wasted in your code. Look here.


For a different Wikipedia article, try http://en.wikipedia.org/wiki/Performance_tuning#Bottlenecks

For a simple how-to, try http://www.wikihow.com/Optimize-Your-Program%27s-Performance

Mike Dunlavey