Best .NET memory and performance profiler? [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We are using JetBrains' dotTrace. What other profiling tools can be recommended that are better for profiling C# Windows Forms applications?

No. I have tried pretty much every .NET profiler on the market (ANTS, vTune, OptimizeIt, DevPartner, YourKit), and in my opinion dotTrace is the best of the lot. It is one of only two profilers I have used (the other being YourKit) that has low enough overhead to handle a highly CPU-intensive application.
If and only if your application is relatively light, I could recommend ANTS Profiler. Its line-by-line stats are sometimes quite useful, but they come at a price in profiling efficiency.

I have used the EQATEC Profiler. It is free and is a code profiler, not a memory profiler.

For memory profiling you have both the free CLR profiler and the commercial .NET memory profiler. Both are excellent but the latter is a bit more polished.

We've got on really well with AQTime. The great thing from our point of view is that it does the unmanaged parts of our code too.

It hasn't been mentioned yet, but for memory analysis Windbg is about as thorough and low-level as you can get. Using it in combination with sos.dll is incredibly powerful, but there is a fairly steep learning curve.
It's a free tool though, and Tess Ferrandez' blog is a great place to start with it. ANTS and other profilers are much more user-friendly, but Windbg can slice and dice the managed heap like none other in my opinion.

Ants Profiler just released version 4.
We use it, and are quite happy with it. There's a 14 day trial to evaluate (as is true for most offerings).

We use DotTrace like you, but in the past we used Ants Profiler by RedGate. It is a nice tool also.

I am very happy with RedGate ANTS. The only other one I tried was the one that comes with Visual Studio Team, and it sucks.

You should check out SpeedTrace. We are pleased with the software, and it helps us a lot in resolving the root causes of my problem.

nProf is a good tool if you're looking for something free. It's kind of finicky at points, and a little buggy, but if you're on a tight budget, it'll do the job.

I've been using the free SlimTune since its recent release. Although it has a minimal interface, it is super easy to use and provides good diagnostics which have already helped me a lot. It currently supports two kinds of displays, one of which is similar to nProf. It is from the same developer as SlimDX, so I expect the tool to become even better in the short term.
EDIT: As far as I know, it does not support memory profiling yet.

Related

How to find out which part of a c# - code consumes to most computer power to optimize this part? [duplicate]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need a C# profiler.
Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order.
Any recommendations?
I used Ants profiler on a large c# project a year and a half ago. It really performed very nicely for what it cost, and even outperformed a few of the more expensive competitors.
It calculates cost on with almost a line by line resolution.
You can try the following:
nprof (free but kinda old)
ProfileSharp (open source)
.Net Memory Profiler (really good for memory leaks, there's a trial version)
Edit:
Nprof has been replaced with SlimTune and works with .Net 4.0 applications
The EQATEC profiler is very good and is completely free. It's easy to setup and use, and doesn't seem to add too much of an overhead to the application. I've just started using it today and have already found a couple of bottlenecks I wouldn't have spotted otherwise.
dotTrace from JetBrains is widely used.
Patrick Smacchia's awesome NDepend is excellent for providing static analysis.
I maintain a comprehensive list of profilers for .NET on SharpToolbox.com.
You'll find there the tools suggested here and more, each with a short description of what it proposes.
It's interesting that no-one mentions that there's one in the higher-end versions of Visual Studio - I've always found that to be good enough for execution profiling. For memory profiling I use Memory Profiler which has already been mentioned, but isn't what I would generally describe as 'a profiler'.
What kind of profiling were you trying to do?
We use Ants profiler where I work. It gives very detailed information in a simple manner.
We use .NET Memory Profiler. Its kinda ugly but very useful for finding dangling references.
I originally tried Red Gate's ANTS profiler which is very sexy, but from a memory leak point of view it sucks for the following reasons:
1) Its ridiculously slow. It was taking half an hour to get the application into a state to start recording (takes 20 seconds without red-gate).
2) Red Gate needs to run its own tool on its own tool. It was using 900MB of memory by the time I finished two snapshots! It then crashed :(
However the timing component of Red Gate ANTS was impressive. Just don't bother with the memory profiler, unless you are dealing with a trivial (small footprint) application.
I have used AQtime and it has never let me down. I am sure there is a trial version.
I'll second red gate's ANTS profiler. I've used it to track down some really troubling performance issues and it was dead simple to use (low learning curve) and presented nice, detailed data in a way that was easy to understand. The price tag is worth it, but it isn't free ...
Patrick Smacchia's awesome NDepend is
excellent for providing static
analysis.
I would thoroughly recommend NDepend for static analysis, but just be warned that you'll probably need to put aside a day or two to actually analyse the truckload of information that it provides as well as work out what all the stats actually mean in terms of your code.
I have had good luck with the .NET memory profiler
EQATEC profiler did the job here.
The current release of SharpDevelop (3.1.1) has a nice integrated profiler. It's quite fast, and integrates very well into the SharpDevelop IDE and its NUnit runner. Results are displayed in a flexible Tree/List style (use LINQ to create your own selection). Doublecliking the displayed method jumps directly into the source code.
Currently don't use them, a buddy of mine raves about Ants profiler. I know its a for-pay product not sure how expensive. If you happen to staff an MVP you might be able to leverage that to get a license for free.
AQTime (both perf and memory) or ANTS (v4 performance profiler or v5 beta memory profiler) here.
I found the .NET Memory Profiler yesterday, and I must say that I'm very impressed by it.
I'm going to order my license today.
Although not very good to profile memory usage, the profiler included in some versions of Visual Studio does a very good job of profiling execution speed.
What's your objective?
Is it your objective to locate specific statements and get a rough idea of what they are contributing to your total execution time, so you can find ways to do them differently?
For that, I swear by this method.

Is a 300MB memory footprint bad? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
We have a c# .NET app that has a footprint of about 300 MB.
My questions:
Do you monitor the memory footprint of your applications?
Is this 300MB footprint bad?
Are there guidelines out there?
Short answer:
We have only once monitored the memory usage of a WPF application, which went on to become pretty serious caused by a bug by one of our third party controls.
Since .NET offers a managed Framework, the only guideline probably is to not worry about memory as long as it does not become a concern. The GC can handle itself pretty well and as long as their is memory still available, why not use it?
So when does it become a concern? Getting out of memory exceptions could be your point when you need to start to worry. I personally have never seen that happen though.
As a rule a static memory footprint is not a problem however large it is, unless it is causing problems on the target computer. The real problem with memory is when you have memory leaks, where the memory is increasing.
The reason I never bother is that I have no idea what a good or bad memory footprint is for a particular application. I think there are better routes to identifying issues within your code than focussing on memory. In simplistic terms, if your code is well written, and you have removed unneeded references, then your memory footprint will be right.
The most important thing is that it does not grow over time. To asess this correctly, it can be useful to do some occasional forced garbage collections, preferably at a time when you expect memory use to be low.
In our GUI app, we do this when a session is closed, which is every 10 minutes or so. If people oppose forcing a GC in a release app, you can make this a debug-build only feature.
I would only worry if the memory grows over a period of time - you may need to use automated testing to repeat operations over and over again in order to expose such memory leaks (see How to test a WPF user interface?)
If you are really worried I would look into using a memory profiler such as Redgate ANTS Profiler or if you want free try CLRProfiler4; the latter is hard work to use but it will still find memory leaks with patience.

Recommendations for choosing a programming language [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Days ago I created a program in Python to download stuff from the Internet, doing HTTP POST and GET and parsing JSON objects. I noticed some slow performance and I was thinking about writing it from scratch using another language, so I started to write it in C++ to make it faster. Finally I give up, C++ wasn't made for the Internet and it's very difficult to get something working.
I was thinking about giving C# or Java a try, which would you recommend? (I need my program to be fully cross-platform, other programming languages are valid too)
Edit: You can check the source code here: http://code.google.com/p/grooveapi/
Rewriting an IO bound application in a different language is unlikely to make any difference in its execution speed.
If you need it to be cross-platform: (i.e. you just write it once and it can run anywhere) Then Java or Python are your only options. This is because any C variant will need compiling specifically for the platform you intend to use it on.
My suggestion: Out of the two I would suggest Python. I have be educated in Java at University, and have learnt Python myself. Python is the language I turn to for web programming projects (in the form of Django on a larger scale) and the language used at companies I have worked for inside of their web applications.
Before you switch to another language... are you sure the performance problems are due to the language itself? It can very well be possible the problem is in the program, or the network latency or any other reason.
Don't blame the language before you've profiled your application carefully, maybe you have a bottleneck somewhere. The cost of a new development will be always very high, specially compared to a few line changes if you've found a problem in your code.
how did you notice "slow performance" when using python? I mean, python is slow, ok, but for your use case it shouldn't matter. Did you profile the code? Can you paste the code here so we can take a look and maybe improve it?
I don't know what kind of performance issues you had with your program in python but it usually does great for me ( scripts parsing log files that are huge take really little time for instance...).
now It all depends on the general purpose of this. If its just a script, no gui etc.. then you should definitely look into optimizing python, or doing some perl or php-cli script.
I'm not familiar with it first hand but ruby seems to have a big following and seems very "internet" oriented aswel.
If you do want to create something more than a script you have lots of options, c# is one of them, but it won't be cross platform, i'd go with java.
In the end I'd recommend rechecking your python code, it seems odd that its not doing what you want performance wise.... python is really good.
You should choose the language you feel most comfortable with. In most cases the performance of the scripting language is not the bottleneck. It is more important to get things done quickly and keep it maintainable. I would recommend you to choose Ruby or Python. If you have to get Python faster you still can choose to use JIT implementation like PyPy. Actually quite high traffic webapps, like YouTube, use Python.
I'd go with the good, old PHP! It has proven time and time again, that it is more than capable of doing this, and is quite easy to learn.
So my advice: Go with PHP!

Is C# a viable language for a major project? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I've been using C# for a while now and I love it for its great integration with Windows. The Win32 API in C++ is a monster, but that's another story. Anyway, I was wondering, is C# a "good enough" language to use for larger projects? Does Microsoft use C# in any of their applications? I've always assumed C++ was the only choice for large projects because of its speed and has no need for the CLR.
What is your opinion on C#?
EDIT: By large I mean applications like Microsoft Project (first example that came to my mind). It could also mean mission-critical applications, as well.
Unless you're after extreme performance (eg gaming), C# is perfectly acceptable for almost any application - I've been developing enterprise-scale apps in it for years and as a general rule, the advantages far outweigh any (negligible) performance losses compared to C++ - especially when you factor in development time and the relatively low cost of improving CPU speed.
Since I've started using C#, it would take a VERY good reason to make me go back to something lower-level like C++ - There are simply so many advantages in terms of ease of development, memory management, a huge library (.Net framework), WCF, LINQ, etc.
I would personally consider C# before any other language when starting a new project
I've using c# since it came out and so far there were only a few things I couldn't do with it such as print drivers. Other than that I developed fairly complex multithreaded server-side applications that are both reliable and fast.
Also - you may want to define "large".
Yes, but I'd encourage you not to follow a Vendor Lock in pattern. Although you could argue that doesn't really apply to .net, but you would lose.
SharePoint and Dynamics (Microsoft products) (and several others) are written almost exclusively in .NET (C#). They would certainly be considered large, enterprise scale applications. Almost all internal project at Microsoft, with the exception or Windows and Office supposedly are written in C# these days (I think it's even a requirement for new projects).
You will incur larger startup times, as you have to load the .NET runtime. Other than that, performance is actually quite good for most things.
And with the garbage collection, memory leaks are less of an issue, so Java and C# both become good options for mission-critical applications (memory leaks grow over time, and can kill things that run for weeks or months at a time. With a more reliable memory footprint, you application can be more stable).
so... yes.

Any decent C# profilers out there? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need a C# profiler.
Although I'm not averse to paying for one, something which is free or at least with a trial version would be ideal since it takes time to raise a purchase order.
Any recommendations?
I used Ants profiler on a large c# project a year and a half ago. It really performed very nicely for what it cost, and even outperformed a few of the more expensive competitors.
It calculates cost on with almost a line by line resolution.
You can try the following:
nprof (free but kinda old)
ProfileSharp (open source)
.Net Memory Profiler (really good for memory leaks, there's a trial version)
Edit:
Nprof has been replaced with SlimTune and works with .Net 4.0 applications
The EQATEC profiler is very good and is completely free. It's easy to setup and use, and doesn't seem to add too much of an overhead to the application. I've just started using it today and have already found a couple of bottlenecks I wouldn't have spotted otherwise.
dotTrace from JetBrains is widely used.
Patrick Smacchia's awesome NDepend is excellent for providing static analysis.
I maintain a comprehensive list of profilers for .NET on SharpToolbox.com.
You'll find there the tools suggested here and more, each with a short description of what it proposes.
It's interesting that no-one mentions that there's one in the higher-end versions of Visual Studio - I've always found that to be good enough for execution profiling. For memory profiling I use Memory Profiler which has already been mentioned, but isn't what I would generally describe as 'a profiler'.
What kind of profiling were you trying to do?
We use Ants profiler where I work. It gives very detailed information in a simple manner.
We use .NET Memory Profiler. Its kinda ugly but very useful for finding dangling references.
I originally tried Red Gate's ANTS profiler which is very sexy, but from a memory leak point of view it sucks for the following reasons:
1) Its ridiculously slow. It was taking half an hour to get the application into a state to start recording (takes 20 seconds without red-gate).
2) Red Gate needs to run its own tool on its own tool. It was using 900MB of memory by the time I finished two snapshots! It then crashed :(
However the timing component of Red Gate ANTS was impressive. Just don't bother with the memory profiler, unless you are dealing with a trivial (small footprint) application.
I have used AQtime and it has never let me down. I am sure there is a trial version.
I'll second red gate's ANTS profiler. I've used it to track down some really troubling performance issues and it was dead simple to use (low learning curve) and presented nice, detailed data in a way that was easy to understand. The price tag is worth it, but it isn't free ...
Patrick Smacchia's awesome NDepend is
excellent for providing static
analysis.
I would thoroughly recommend NDepend for static analysis, but just be warned that you'll probably need to put aside a day or two to actually analyse the truckload of information that it provides as well as work out what all the stats actually mean in terms of your code.
I have had good luck with the .NET memory profiler
EQATEC profiler did the job here.
The current release of SharpDevelop (3.1.1) has a nice integrated profiler. It's quite fast, and integrates very well into the SharpDevelop IDE and its NUnit runner. Results are displayed in a flexible Tree/List style (use LINQ to create your own selection). Doublecliking the displayed method jumps directly into the source code.
Currently don't use them, a buddy of mine raves about Ants profiler. I know its a for-pay product not sure how expensive. If you happen to staff an MVP you might be able to leverage that to get a license for free.
AQTime (both perf and memory) or ANTS (v4 performance profiler or v5 beta memory profiler) here.
I found the .NET Memory Profiler yesterday, and I must say that I'm very impressed by it.
I'm going to order my license today.
Although not very good to profile memory usage, the profiler included in some versions of Visual Studio does a very good job of profiling execution speed.
What's your objective?
Is it your objective to locate specific statements and get a rough idea of what they are contributing to your total execution time, so you can find ways to do them differently?
For that, I swear by this method.

Categories