473,763 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
+ 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 2345
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
1887
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 Server 2000 (sp3 i think). Whenever I start up SQL Profiler - even immediately after a bootup, if I try to pause, stop, or exit out of profiler, it hangs. The strange part is that it seems to keep on tracing even though it won't respond anymore. I...
8
2836
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 a query that profiler reported as having 0 reads and ran in in query analyzer wtih STATISTICS IO on and confirmed that there are in fact reads: Table 'tt_cawardalloc'. Scan count 1, logical reads 8, physical reads 0, read-ahead reads 1. Table...
0
1657
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 profiler that looks like DevPartner Profiler (gives the same information: shows clearly which methods/statements takes the most time in total etc and free!). Or will DevPartner make a version for 2005 soon?
4
4090
by: pnp | last post by:
Which is the best profiler for C# apps? Thanks in advance, Peter
1
2289
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 docs now only say something about atttaching a third party tool, but do not give any hints of what that might be. Can the old VC6 profiler be used with a fresh VC .Net compile (totally unmanaged code). Any advice, hints, etc appreciated.
3
1693
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 in the following way 1) Build the project with link setting- Enable Profiling as checked. 2) I had created a custom batch file for profiling my application and was
3
2315
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 suggestions/experiences/recommendations that thay would like to share? Any comments much appreciated... Al.
1
3178
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 @tracefile = NULL so where from the profiler read the results?!
0
5056
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 taking some scenarios. Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for monitoring an instance of the SQL Server Database Engine or Analysis Services. You can capture and save data about each event to a file or table to...
0
9389
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10003
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9943
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9828
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
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 we have to send another system
2
3529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2797
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.