Any decent C# profilers out there? [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 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.

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.

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.

Going to jump into Powerbuilder. Any advice [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.
This might be a weird question. After all, most people want to jump OUT of PB not IN.
However, after careful analysis, I feel that Powerbuilder can get things done so much more rapidly than C# in the sense its a 4GL.
Now PB is becoming .NET enabled, I was thinking perhaps its a good tool.
My main focus is developing enterprise applications with alot of data entry/reporting/data representation.
I have tried the datagridview and its pretty bad compared to the datawindow. I initially wanted to buy and try the telerik solutions but due to lack of time, i just assume the implementation in C# is just as unwieldy.
Do you feel its a good idea to jump into Powerbuilder now since its the only 4GL committed to moving to .net?
Thanks so much all. Do not hesitate to critique my choice based on my crieria:
c# is very low level and theres alot of coding to be done concerning data bound controls and so on
powerbuilder is a 4gl and has excellent abstractions to avoid unneccessary coding. Sure, you give up a bit of control but how much control is required for an enterprise application? C# is an extremely powerful language and yes you can make literally anything in C#. But Powerbuilder is more limited, and more can be done in PB when making stuff in its scope: i.e. enterprise apps
powerbuilder is moving to .NET and it can be extended by using C# for more sophisticated stuff.
yes, i am aware theres a DataWindow.NET control which is excellent but however does not give assurances of longevity since Sybase may not continue supporting it after traction for PB.NET is seen. After all it will cannibalize sales for PB.NET
You are correct that PB can be very productive. And ultimately, the strategy of "using what works" is fine. That said, there are some things to be careful about.
It sounds like you are developing a brand new app. If so, that's good, you have a chance to build it as a .Net PB app from day 1. PB 12 is to C# what PB classic is to C++, so your reason (wanting a higher level entry point to .Net) to use PB is in line with what I think Sybase was intending.
Do it as part of an overall solution including the .Net integration you speak of, and definitely take advantage of the educational opportunity to learn C#. As a developer, .Net is better for future opportunities than PB.
Will you need to readily hire additional resources to help develop/support the application? It may be harder to find PB resources than .Net resources, given the language popularity trends. Note that I make no claims on the quality of the developers: PB or .Net, you'll find journeymen, hacks and stalwarts in both ranks.
I wouldn't worry too much about Datawindow .Net if you decide to use it. I don't expect it will go away but someone more familiar with it may be able to provide more context here.
Finally, although there is some value in having a higher level entry point to C#, you will have to learn something about both PB and C#. Managing two tools introduces more overhead than managing one tool. For typical CRUD apps where you are building a lot of data entry and reporting, the productivity gains and strong relationship between SQL and the datawindow may be worth it - that's up to you to decide.
If possible, I would suggest you wait some time to see how PB12 is really doing. What worries me is this:
Existing PB application can, theoretically, be compiled into native code. This works horribly. Or, to be precise, it doesn't work at all. How well is PB going to export to .NET is yet to be determined. They seem to be committed to that, but I wouldn't trust them without seeing some real-world proof that works.
Based on PB11.5 and below, Sybase has been doing a bad job with PB IMHO. They rush into new technologies, but the foundations are shaky. PB12 is a big change, and based on their quality of development, I would wait at least a few builds before using it.
PB can indeed be productive, but being a PB programmer, I just can't imagine someone actually getting into it now. You'll have a very small community, not much open source, and an unclear future. And, based on recent experience, Sybase's support is also quite lousy.
Finally, if you do go through with this, the best advice I can give you is this: design your project having in mind you might have to port it to another language one day. Can't say exactly how since I'm not a .NET programmer and I haven't used PB12 yet, but have that in mind. I wish our app, which goes back up to PB3 or even PB2, was portable.
thanks so much everyone.
I have decided to stick with C# due to a fear (perhaps irrational) that Sybase will be slow to catch up with future .NET upgrades
Because I am still young and working on greenfield applications, i prefer to choose a language that has longevity and support.
Nevertheless, I feel its a shame that Powerbuilder isnt as popular compared to other language, for I can see awesome producivity improvements and the datawindow control is one of the more impressive databound controls i have seen in a long while.
Thanks again, eran and Bernard!
I don't think you have to fear that PB will go away anytime soon, it has been around a long time ever evolving and it will continue to stick around. There is a very active user community and many larger corporations still use it.
I think also it is good to learn as many tools/languages as possible at least from perspective of coming in contact with different programming paradigms. PB is great for certain projects, C# for others - they don't necessarily cancel out each other.
You can take a look at the latest PB.NET (Beta2) here

Best .NET memory and performance profiler? [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 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.

Categories