Free .NET Profiler for .NET 4.0 mixed code
Asked Answered
E

5

6

I checked out some of the performance profilers mentioned here. But...

  • EQATec didn't work for me because I have many assemblies I want to profile, and it has a limit on assemblies to profile. How much of a hassle is getting a free license? I'd go for it if someone guaranteed me that EQATec can profile both managed and unmanaged code
  • SlimTune only profiled my managed code, even if I set "Profile native functions" to "True"
  • XTE Profiler is no longer free
  • We have a copy of AQTime 6 we bought before, but it doesn't seem to support .NET 4.0 apps (it can't even start my app)
  • We use Visual Studio 2010 Professional SP1, so we don't have the Visual Studio profiler
  • I tried the "poor man's profiling" (halting the program many times and seeing where it is), but I get way too random results and I'm more used to traditional profiling

(I've spent the whole day stumped on this, sorry if I was too negative)

UPDATE: After I cleaned my solution, built it again and checked all debug info (.pdb) was copied to the same directory as the executable, I tried AQTime again and it worked! It showed me routine timing info for both managed and unmanaged code, so my problem is solved. However, I'm using a paid profiler, so the question will remain open until I take a look at xperf or someone comes up with something else

Endotoxin answered 28/6, 2011 at 19:30 Comment(3)
+1; I don't think you sound negative! I think you sound frustrated, but since you document your frustration well, it is hard to disagree (your not being lazy, a penny pincher at worst)Meenen
+1 for teaching me the "penny pincher" ...expression? (I'm not a native English speaker) :PEndotoxin
me neither, I looked it up :) Bounced back and forth through a thesaurus just to find something matching what I wanted to expressMeenen
T
3

AQTime have a free version of their latest profiler (http://smartbear.com/products/free-tools/aqtime-standard/) It supports .Net 4, But I doubt it can do a mixed profile of Native and Managed.

If you are really serious about it you might look into the Microsoft xperf tools (http://msdn.microsoft.com/en-us/performance). They have a steep learning curve but they are free and I doubt any commercial profiler can do what xperf can (the instrumentation is in the OS, not in a separate process, thus either Vista, win7 or win2K8 are required). I'm waiting for someone to write a nice GUI around it, but it's taking a bit long... ;-)

xperf will profile your native code and you can load your symbols into the result viewer. I don't think it will go down to per-line granularity though. It has has a .Net CLR Provider (http://msdn.microsoft.com/en-us/library/dd264809.aspx). The cool thing about xperf is that it can also show other processes that may be influencing your performance (you are free to switch it off and only profile your own process). For example: it is capable of revealing that your IO is slow due to a badly written USB driver, virus scanner or firewall software. A traditional profiler would only show the slow IO, causing you to focus on a non-bottleneck.

By the way, there is also an ICorProfilerCallback interface you can utilize to write your own profiler (http://msdn.microsoft.com/en-us/library/s5ec0es1.aspx).

Tadeas answered 29/6, 2011 at 22:7 Comment(0)
M
1

I' pretty sure the answer to your question is "There isn't one".

In comparing a whole bunch of .NET profilers a few months ago I found only very few could do mixed .NET/native profiling: AQTime ($599) and Glowcode ($499) could. Or so they say - I didn't try it.

EQATEC, Visual Studio, ANTS, Jetbrains dotTrace, Yourkit, XteProfiler, Slimtune etc could not, so I doubt you'll find a free profiler anytime soon that can.

Mildew answered 9/7, 2011 at 20:36 Comment(6)
Did you try xperf? See @Louis Somers' answerEndotoxin
I have used xperf, but only for native code - not managed code. In general it's not an easy tool to use. Just take a look at the "easy 10-step guide" at blogs.msdn.com/b/seema/archive/2008/10/08/… and you'll see what I mean. All you get is raw CPU-cycle graphs for library/system calls with no correlation to your own app's code and in my opinion this alone means that xperf is simply not a serious tool for .NET profiling.Mildew
I read the post you linked to and I'm not so sure, perhaps it's possible to configure xperf to use my app's debug symbols as well as the runtime's. I'll give it a try and come back to you, but it might take some time because right now I have exams at collegeEndotoxin
I'm not saying it's impossible, but it appears to be a rather painful route to take. BTW, are you sure you need mixed-mode profiling at all? I've done lots of "mixed programming" (.NET p/invoking C++) and never really needed actual mixed-mode profiling: just profiling the managed code pointed me to every actual bottleneck, including indirectly those in the native code.Mildew
Yes, we really need it, our unmanaged code base is pretty large and contains mission-critical spots. And the interactions with managed code are quite complex; there is lots of legacy code on both the managed and unmanaged side. Now I'm happy with AQTime, but I promise that as soon as I get some free time, I'll take xperf for a spin and if it doesn't cut it, I'll accept your answerEndotoxin
There's actually a real simple solution: just use both a managed and unmanaged profiler at the same time. With EQATEC Profiler this works like a charm, because once it has instrumented your app the profiler itself doesn't need to be involved at all: the instrumented app does all the timing itself no matter what pace you put it through, including running your app in another unmanaged (or even managed!) profiler. See eg forum.eqatec.com/default.aspx?g=posts&t=493Mildew
N
0

OP: "I'd go for it if someone guaranteed me that XXXX can profile both managed and unmanaged code"

Our C# Timing Profiler is not dependent on how your C# code is compiled (managed or unmanaged, or mixed). It should work fine for this.

Nayarit answered 28/6, 2011 at 22:21 Comment(4)
It's no good, I forgot our codebase has some dlls written in VB.NET, so I don't think your solution will doEndotoxin
We don't presently have a VB.net profiler tool, true. Without that, the C# profiler won't be able to capture time inside the VB.net routines, but it should capture execution time of all the C# code.Nayarit
Guys, it's not free any longer. Now it's shareware: "Evaluation downloads have full file handling capability, but have the functional limits stated in the installed documentation until they are registered with a registration obtained with an actual purchase of a license. With the evaluation limits in place you can still setup your environment and evaluate the product, then if desired purchase a license, and register the product to see the full results. "Conditioning
It was never free and we've never made any such claim. The phrase "our ..." is long accepted by SO to indicate this is something with which the poster (me) have an intimate connection (e.g., I happend to be the builder/seller). It has always been provided as an evaluation download with option to upgrade. OP has shown he has already purchased commercial software, and other answers seemed to indicate there were no good solutions. Ours will do it.Nayarit
D
0

CLR Profiler 4 by Microsoft is free. Have you tried it?

What do you look for in the unmanaged part of the profiler?

Doall answered 28/6, 2011 at 22:33 Comment(1)
The same I look for in the managed part: which function or line is consuming more time. I tried it once, it crashed as soon as I launched it. Serious.Endotoxin
M
0

Your concern about EQATEC Profiler is easily resolved: it only does managed .NET profiling, not at all any kind of unmanaged profiling.

As shown in the pricing the actual profiling functionality differs only in the number of assemblies that can be profiled at once. So a $0 Free edition profiles a single-assembly WP7-app just as fine as a $999 Corporate edition does. For the extra price tag you get to profile more assemblies at once and a handful secondary features, like print, compare, min/max etc.

Getting a free license by trying out EQATEC Analytics is said to be easy. Going for the unlimited Corporate license is quite a popular choice and many have achieved it in just a couple of hours. Getting a free $99 Standard license shouldn't take more than 10 minutes or so, if you're good. Please note: I work at EQATEC and we actually hand out so many free licenses every day now that's it's almost become a burden because each is manually processed (yes, seriously!) so this particular offer may not go on forever.

Mildew answered 29/6, 2011 at 1:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.