<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Tim Barcz - NHProf</title>
    <link>http://www.timbarcz.com/blog/</link>
    <description>My Code is My Craft</description>
    <image>
      <url>http://www.timbarcz.com/blog/content/binary/channelImage.jpg</url>
      <title>Tim Barcz - NHProf</title>
      <link>http://www.timbarcz.com/blog/</link>
    </image>
    <language>en-us</language>
    <copyright>Tim Barcz</copyright>
    <lastBuildDate>Tue, 09 Dec 2008 07:09:57 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>blog@timbarcz.com</managingEditor>
    <webMaster>blog@timbarcz.com</webMaster>
    <item>
      <trackback:ping>http://www.timbarcz.com/blog/Trackback.aspx?guid=e237b148-f281-426f-b3d7-c622d43c1934</trackback:ping>
      <pingback:server>http://www.timbarcz.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.timbarcz.com/blog/PermaLink,guid,e237b148-f281-426f-b3d7-c622d43c1934.aspx</pingback:target>
      <dc:creator>Tim Barcz</dc:creator>
      <wfw:comment>http://www.timbarcz.com/blog/CommentView,guid,e237b148-f281-426f-b3d7-c622d43c1934.aspx</wfw:comment>
      <wfw:commentRss>http://www.timbarcz.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e237b148-f281-426f-b3d7-c622d43c1934</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NHProfWhatistheroleoftheDBA_DB9/Icon_thumb.png" align="right" /> Over
the past week I've had the distinct opportunity to have a first-hand look into <a href="http://ayende.com/Blog/archive/2008/10/13/nhprof-another-milestone.aspx">NHProf</a>, <a href="http://www.ayende.com/blog/">Ayende's</a> upcoming
profiler for <a href="http://www.hibernate.org/343.html">NHibernate</a>.  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.
</p>
        <p>
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:
</p>
        <h2>Easy To Understand
</h2>
        <p>
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 <a href="http://www.jetbrains.com/resharper/">ReSharper</a> or <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush</a>,
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:
</p>
        <p>
          <a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_6.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="412" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_2.png" width="575" border="0" />
          </a>
        </p>
        <p>
That's messy but take a look at how NHProf collates the data:
</p>
        <p>
          <a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_4.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_1.png" width="249" border="0" />
          </a>
        </p>
        <h2>Relevant
</h2>
        <p>
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.
</p>
        <p>
          <a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_8.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="578" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_3.png" width="578" border="0" />
          </a>
        </p>
        <p>
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.
</p>
        <h2>Performance Gains
</h2>
        <p>
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 <a href="http://www.hibernate.org/362.html">NHibernate</a> generates
I can also make modifications to query I'm submitting to <a href="http://www.hibernate.org/362.html">NHibernate</a> for
further performance gains.
</p>
        <p>
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.
</p>
        <h3>Before:
</h3>
        <h2>
          <a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_10.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="124" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_4.png" width="337" border="0" />
          </a>
        </h2>
        <h3>After:
</h3>
        <p>
          <a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_12.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="114" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_5.png" width="314" border="0" />
          </a>
        </p>
        <h2>Conclusion
</h2>
        <p>
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 <a href="http://www.jetbrains.com/resharper/">ReSharper</a> or <a href="http://devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush</a> 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.
</p>
        <p>
Keep your eye on <a href="http://www.ayende.com/blog/">Ayende's blog</a> for information
coming soon.
</p>
        <img width="0" height="0" src="http://www.timbarcz.com/blog/aggbug.ashx?id=e237b148-f281-426f-b3d7-c622d43c1934" />
      </body>
      <title>NHProfiler - An Early Look</title>
      <guid isPermaLink="false">http://www.timbarcz.com/blog/PermaLink,guid,e237b148-f281-426f-b3d7-c622d43c1934.aspx</guid>
      <link>http://www.timbarcz.com/blog/NHProfilerAnEarlyLook.aspx</link>
      <pubDate>Tue, 09 Dec 2008 07:09:57 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/NHProfWhatistheroleoftheDBA_DB9/Icon_thumb.png" align="right" /&gt; Over
the past week I've had the distinct opportunity to have a first-hand look into &lt;a href="http://ayende.com/Blog/archive/2008/10/13/nhprof-another-milestone.aspx"&gt;NHProf&lt;/a&gt;, &lt;a href="http://www.ayende.com/blog/"&gt;Ayende's&lt;/a&gt; upcoming
profiler for &lt;a href="http://www.hibernate.org/343.html"&gt;NHibernate&lt;/a&gt;.&amp;#160; It's
been an honor to be part of the team that is putting NHProfiler through its paces.&amp;#160;
While NHProfiler is still in private beta it is very impressive and I want to let
you peek inside.
&lt;/p&gt;
&lt;p&gt;
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.&amp;#160; Here's what I found:
&lt;/p&gt;
&lt;h2&gt;Easy To Understand
&lt;/h2&gt;
&lt;p&gt;
You can get by without purchasing NHProf, from what I see there's nothing you can't
&amp;quot;figure out&amp;quot; yourself.&amp;#160; NHProf is a lot like &lt;a href="http://www.jetbrains.com/resharper/"&gt;ReSharper&lt;/a&gt; or &lt;a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/"&gt;CodeRush&lt;/a&gt;,
you can get by without it, but why would you want to?&amp;#160; Here's what I mean, you
can pop open SQL Server Profiler and see what is being executed:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="412" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_2.png" width="575" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
That's messy but take a look at how NHProf collates the data:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_1.png" width="249" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;h2&gt;Relevant
&lt;/h2&gt;
&lt;p&gt;
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.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="578" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_3.png" width="578" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
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.
&lt;/p&gt;
&lt;h2&gt;Performance Gains
&lt;/h2&gt;
&lt;p&gt;
We all want our applications to run faster.&amp;#160; We want speed and performance but
often times its takes quite a bit of time to find performance problems and their subsequent
fixes.&amp;#160; NHProfiler allowed me to very quickly find some queries that didn't need
to be executing and tweak some code to eliminate those calls.&amp;#160; Since I can see
the code that &lt;a href="http://www.hibernate.org/362.html"&gt;NHibernate&lt;/a&gt; generates
I can also make modifications to query I'm submitting to &lt;a href="http://www.hibernate.org/362.html"&gt;NHibernate&lt;/a&gt; for
further performance gains.
&lt;/p&gt;
&lt;p&gt;
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.&amp;#160;
How do I know that, I have the hard data to prove it.
&lt;/p&gt;
&lt;h3&gt;Before:
&lt;/h3&gt;
&lt;h2&gt;&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="124" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_4.png" width="337" border="0" /&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;h3&gt;After:
&lt;/h3&gt;
&lt;p&gt;
&lt;a href="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="114" alt="image" src="http://www.timbarcz.com/blog/content/binary/WindowsLiveWriter/NHProfilerAnEarlyLook_1033/image_thumb_5.png" width="314" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;h2&gt;Conclusion
&lt;/h2&gt;
&lt;p&gt;
If you use NHibernate, NHProfiler is a must.&amp;#160; 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.&amp;#160; I am quickly able to observe what is going
on and when and make any necessary modification and then observe the outcome.&amp;#160;
While you can use Visual Studio without &lt;a href="http://www.jetbrains.com/resharper/"&gt;ReSharper&lt;/a&gt; or &lt;a href="http://devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/"&gt;CodeRush&lt;/a&gt; many
of you out there have found you just don't want to.&amp;#160; After using these productivity
tools you find that you're able to work with less friction.&amp;#160; NHProfiler is the
same way, you can work without it, but I highly recommend against it.
&lt;/p&gt;
&lt;p&gt;
Keep your eye on &lt;a href="http://www.ayende.com/blog/"&gt;Ayende's blog&lt;/a&gt; for information
coming soon.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.timbarcz.com/blog/aggbug.ashx?id=e237b148-f281-426f-b3d7-c622d43c1934" /&gt;</description>
      <comments>http://www.timbarcz.com/blog/CommentView,guid,e237b148-f281-426f-b3d7-c622d43c1934.aspx</comments>
      <category>NHibernate</category>
      <category>NHProf</category>
      <category>Tools</category>
    </item>
  </channel>
</rss>