473,471 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code Profiler

A few years ago I used a Profiler (I forget the name) on my Delphi code at
the time and got fantastic results showing both:
a) lines of code that took the longest to execute and
b) lines of code that allocated the most unreleased memory.

I have looked around and am unable to find a good tool to easily achieve
these statistics for my C# Winforms application. Possible reasons are that:
1) I am having difficulty finding the existing functions in a tool thet supplies
them or
2) I have not yet found the tool that does actually supply them.

I also wonder if my statistic b) above is no longer able to be profiled because
dotnet has a garbage collector whereas Delphi did not? Some of them seemed
to say that to observe changes in memory allocation over time I needed to
take "snapshots". However I can't see how that will help me with that specific
requirement anyway.

The profilers I have looked at are:-
* ANTS Profiler
* AQTime
* CLR Profiler
* ProfileSharp
* SilkTest
* YourKit

Am I on the right track or have I missed the right product?

Any advice on which direction you think I should go (more time understanding
or more time downloading) would be much appreciated.

cheers,
Paul.
Dec 2 '07 #1
2 2321
Hello,
The profilers I have looked at are:-
* ANTS Profiler
* AQTime
* CLR Profiler
* ProfileSharp
* SilkTest
* YourKit
* dotTrace?
I also wonder if my statistic b) above is no longer able to be profiled
because dotnet has a garbage collector whereas Delphi did not?

The CPU profiler helps with finding the functions (not lines of code, but
functions) which take the most execution time. The profiler would collect
statistics for some period of time. After that, you can see the share of
that time each function took, in percent, and whether that time was spent
within the own code of that function, or rather in a call to some other function,
in percent again. By tracking down the tree of function calls, starting with
the thread node that is assumed to run 100%, you determine the bottleneck
functions that take, say, 75% of your application startup.

The memory profiler tracks the creation and lifetime of the objects. In .NET,
you cannot have an old-style memory leak (as Garbage Collection would reclaim
the no-more-needed objects), still it may so happen that an object is erronousely
prevented from being collected. Someone may be still holding a reference
to the no-more-needed object, effectively marking it as “alive”, and that's
the main issue to be tracked down in memory profiling. You cannot readily
tell such references from normal ones, so you'd be making those “snapshots”
to hunt it down. First, you run the application being tested for some time,
so that all of the lazy-init happened. Then you take the first snapshot,
“before”. After that, you perform a series of actions, like opening windows,
running operations, etc, and then return the app to the same state as when
taking the first snapshot (close the new windows, …). Logically, it should
take no more memory than before, if there are no leaks (save for caches).
At this point you take the second snapshot, “after”, and make the profiler
show you the difference. Those are the potential leaks. For each such object,
you can see the line of code that created it, and the objects that are holding
a reference to it and preventing it from being collected by GC.

Basically, that's it.

(H) Serge
Dec 2 '07 #2
On Dec 2, 1:00 am, Paul Ritchie <REMOVEpritc...@xtraREMOVE.co.nz>
wrote:
[....]
>
The profilers I have looked at are:-
* ANTS Profiler
* AQTime
* CLR Profiler
* ProfileSharp
* SilkTest
* YourKit

Am I on the right track or have I missed the right product?
nprof ?

-- Henon

----
my site: http://www.eqqon.com
Dec 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Mair | last post by:
Hello all, I haven't been using profiler for a terribly long time, and I've come across something that I just can't figure out. I'm running MS Virtual PC to run a Win2K Server OS with SQL...
8
by: patrickshroads | last post by:
I am running a profiler trace against a database and noticed that the reads column always shows 0. When running the same trace against another machine I get back values in the reads column. I took...
0
by: DraguVaso | last post by:
Hi, I'm using for a while DevPartner Profiler (http://www.compuware.com/products/devpartner/resources/profiler/profiler.as p), but unfortunately it works only for 2002 and 2003. Is there a...
4
by: pnp | last post by:
Which is the best profiler for C# apps? Thanks in advance, Peter
1
by: Mikey | last post by:
Can somebody tell me what happened to the Source Profiler? It used to be under the Build menu in VC6, but now it's gone, and I cannot find anything in the docs that say what happened to it. The...
3
by: Maansi Gupta | last post by:
Platform - Windows 2000 Professional , VC .NET 7.1 Hello, I have recently ported my source code from Visual Studio 6.0 to .NET 7.1 Previously with Visual Studio 6.0 I was using the profiler...
3
by: almurph | last post by:
Folks, I'm looking for a good, free VB.NET profiler to look at my code as I run it and make intelligent suggestions as how to make it go faster etc... Anyone with any...
1
by: ofirmgr | last post by:
im trying to understand how the profiler works. so i started 2 profilers,one listen to another and I saw the profiler is running: exec sp_trace_create @P1 output, 1, NULL, NULL, NULL which means...
0
by: anweshadash | last post by:
Using SQL Profiler: (Ref: http://msdn2.microsoft.com/en-us/library/ms181091.aspx) Sometimes it’s very beneficial to use sql profiler. Let’s have an idea about that and how to use that by...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.