views:

81

answers:

3

In my website I have a rather complicated business logic part encapsulated in a single DLL. Because CPU usage hits the roof when I call certain methods of it I need to measure and optimize.
I know about the performance profiler, but I don't know how to set it up for a library.
Furthermore I don't seem to find any usefull resources about it.

How do you approach this problem?

+1  A: 

You can create a simple exe that runs the main methods of your library. Although it requires some understanding to know which method to call it can help you focus on speciifc scenarios and check their bottlenecks.

Dror Helper
A: 

You can also put some performance counters: look into msdn, or open a debugger and use old system: create a Stopwatch and do Debug.Writeline to see what's happening.

jmservera
A: 

As Dror says, run it stand-alone under a simple exe. I would add, run THAT under the IDE, and while it's being slow, just pause it, several times, and each time look in detail at what it's doing. It's counterintuitive but very effective.

Mike Dunlavey