Fog Creek Software
Discussion Board




Win32 Api Profiling

My Google search did not locate what I am curious about, and so am wondering if anybody here would have some insight into the profiling of all Win32 API functions.

When I programmed in Assembly, every book had a list of all of the opcodes and how many cycles they took on a given machine.  I am wondering if there might be a similar document somewhere detailing the Win32 API functions.

sedwo
Tuesday, May 11, 2004

I expect that a Win32 API call varies too much to be documentable. For example, the number of opcode that it takes to ReadFile depends on which Win32 O/S it is, where the data is (on disk, in RAM cache, or on the network), what kind of device it is, how much data you're reading, etc.

Instead, you use a run-time profiler.

Even in assembly,  on a Pentium the cycles per opcode vary now (depending on pipelining, address generation interlocks, branch prediction, the cache, etc.) so again a run-time profiler is recommended.

Christopher Wells
Tuesday, May 11, 2004

Incidentally, can you recommend a profiler for .NET?

I downloaded the MS CLR Profiler at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenethowto13.asp ... it's good at identifying heap usage, less good at identifying CPU usage (in fact it doesn't seem to measure time at all).

I'd like some of the functionality that I had with the MSVC v6 Profiler, specifically:
- I specify a starting function
- I run a test
- The profiler tells me how much CPU time (or wall clock time) was spent in each subroutine of the specified function.

Christopher Wells
Tuesday, May 11, 2004

If you watch the nprof site long enough you might get a free .NET profiler eventually... but the last update was on 22 January:
http://nprof.sourceforge.net/Site/SiteHomeNews.html

Then we have AQTime .NET 2 for US$600:
http://www.automatedqa.com/products/aqnet.asp

And CompuWare DevPartner studio for a whopping US$1700:
http://www.compuware.com/products/devpartner/studio.htm

I don't have experience with any of them. The current version of nprof crashed when I tried it, any the others are too expensive.

Chris Nahr
Tuesday, May 11, 2004

For commercial products, I like Red-Gate Ants a lot. You can use it for free for 14 days.

http://www.red-gate.com/code_profiling.htm

Brad Wilson (dotnetguy.techieswithcats.com)
Tuesday, May 11, 2004

You can download the community edition of devpartner for free -- it does require the VS.Net ide though...

http://www.compuware.com/products/devpartner/profiler/default.asp

O Canader
Tuesday, May 11, 2004

Thank you all.

The DevPartner Profiler Community Edition is beautiful. Another thing it requires, on my machine with my project, is that the IDE process is now using an extra 100MB of RAM.

Christopher Wells
Wednesday, May 12, 2004

I don't like the questionnaire that you have to fill out in order to get that community edition. Way too much personal information for my taste.

Chris Nahr
Wednesday, May 12, 2004

Compuware's privacy policy is at http://www.compuware.com/corporate/602_ENG_HTML.htm ... they say that they support "opt-out".

It was easier for me to give them information than the whopping US$1700 (especially considering that the IDE profiler was the only tool of theirs that I wanted at the moment).

Also, I figure that, because they were cool enough to buy NuMega's products, I don't mind letting them know of my existence.

Anyway, that profiler is doing just what I wanted it to do.

Christopher Wells
Wednesday, May 12, 2004

Chris,

Um, lie on the form.  Get a Hotmail account to recieve the key if necessary...

O Canader
Wednesday, May 12, 2004

The email that they send doesn't contain a key. It contains an URL to a whitepaper on .NET memory management, an URL to their privacy policy, and opt-out instructions.

Christopher Wells
Thursday, May 13, 2004

*  Recent Topics

*  Fog Creek Home