Over the past week I've had the distinct opportunity to have a first-hand look into NHProf, Ayende's upcoming profiler for NHibernate. It's been an honor to be part of the team that is putting NHProfiler through its paces. While NHProfiler is still in private beta it is very impressive and I want to let you peek inside.
This evening I decided to sit down and spend some time poking around an application and watch NHProfiler to see if anything seemed out of sorts. Here's what I found:
Easy To Understand
You can get by without purchasing NHProf, from what I see there's nothing you can't "figure out" yourself. NHProf is a lot like ReSharper or CodeRush, you can get by without it, but why would you want to? Here's what I mean, you can pop open SQL Server Profiler and see what is being executed:
That's messy but take a look at how NHProf collates the data:
You can sift through the SQL Server Profiler trace if you'd like to but NHProfiler does a great job in giving you the same information, just presented better.
From this view I can see that five queries were run and I can see that three of the same queries are being issued which might point to an area where there is some tweaking to do.
We all want our applications to run faster. We want speed and performance but often times its takes quite a bit of time to find performance problems and their subsequent fixes. NHProfiler allowed me to very quickly find some queries that didn't need to be executing and tweak some code to eliminate those calls. Since I can see the code that NHibernate generates I can also make modifications to query I'm submitting to NHibernate for further performance gains.
In a very short amount of time (the writing of this blog post has taken several times longer) I was able to reduce reduce data access time by a factor of nearly 10. How do I know that, I have the hard data to prove it.
If you use NHibernate, NHProfiler is a must. By using NHProf to observe my applications I'm able to save my time and not have to burrow through SQL Server Profiler or wonder what is going on at the data level. I am quickly able to observe what is going on and when and make any necessary modification and then observe the outcome. While you can use Visual Studio without ReSharper or CodeRush many of you out there have found you just don't want to. After using these productivity tools you find that you're able to work with less friction. NHProfiler is the same way, you can work without it, but I highly recommend against it.
Keep your eye on Ayende's blog for information coming soon.