Use measureIt to find out how much time it really takes

I’ve been interested in performance optimization from the first application I wrote and since than I been finding new ways to make my code run faster with less memory usage. Over the time I found that after discovering the existing bottlenecks in the code knowing which command takes more time to execute is always an easy win when in need of optimizing a specific code.

There are several ways to find the performance implications of different code snippets – writing a benchmark, searching the Internet and one of my favorites using measurIt.

This simple tool written by Vance Morrison from Microsoft’s .NET runtime team runs several well used .NET snippets and outputs the time it took to run each snippet.

For example acquiring ReaderWriterLock takes more time then using simple lock/Monitor.Enter:

image

Using measureIt saved me some time and should help resolving the known argument of which command takes more time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s