Boris Callens
Boris Callens

Reputation: 93367

Measure performance bottlenecks in a library

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?

Upvotes: 0

Views: 234

Answers (3)

Mike Dunlavey
Mike Dunlavey

Reputation: 40689

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.

Upvotes: 0

jmservera
jmservera

Reputation: 6682

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.

Upvotes: 0

Dror Helper
Dror Helper

Reputation: 30819

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.

Upvotes: 1

Related Questions