Almost a year ago now I wrote part 1 and part 2 of a MSDN article entitled 'Measure Early and Measure Often for Good Performance'. In this article I argued that if you want to design high performance applications you need to be measuring performance early and often in the design process. To help doing this I posted a tool call 'MeasureIt'. It basically makes it easy to write benchmarks for .NET code. In particular it also comes with at set of built-in benchmarks that measure the most important fundamental operations in .NET, so you can know what is expensive and what is not.
Well, is has been a almost a year, and I have made a few bug fixes / improvements ot MeasureIt since then, so this post brings MeasureIt up to date. It also allows me to correct a mistake I made when I posted the unoptimized version of MeasureIt for that article. It also allows me to improve the user experience during the download.
MeasureIt is supper easy to use in the simple case (just run it), and has good documentation (MeasureIt /usersGuide). You are in fact only 7 clicks away from running it right now. To do so
- Click on the 'MeasureIt.zip' link at the bottom of this article. This brings up a download dialog box.
- Click on the 'Open' button. This brings up a security dialog.
- You should click 'Allow' on the security dialog. (Yes you have to trust me). This opens the ZIP archive.
- Click on the 'MeasureIt' directory (alternatively you can copy it to your hard drive).
- Click on the 'MeasureIt.exe' file
- Click on the 'Run' dialog box that comes up.
- You may get another security dialog. You have to allow that.
At this point it runs MeasureIt. It takes a few seconds for it it run and then it displays the data on the costs of 50 or so .NET operations. As mentioned in the article, this it really useful stuff. MeasureIt comes with its own source code, and typeing 'MeasureIt /Edit' allows you to add more benchmarks to it if you want to measure somethign of your own.
Happy Performance Investigating!