Download Nhibernate Profiler ((BETTER))

0 views
Skip to first unread message

Lajuana Berey

unread,
Jan 25, 2024, 1:17:05 AM1/25/24
to zagiwesttop

I'm trying to use NHibernate Profiler in a .NET Core 3.1 MVC app and although I've tried installing what the profiler insists it needs to be it's job (via nuget), I still cannot get NHibernate Profiler working with .NET Core 3.1.

After seeing NHProfiler in action for the first time I was completely blown away! I ran the profiler against a content management system which I was developing and quickly identified a number of queries that could be optimised resulting in a significant increase in performance. This is not only a great tool for debugging, developing and scaling data driven applications but it also helps me to have a deeper understanding of the NHibernate framework. I now consider NHProfiler a must have tool when using NHibernate.

download nhibernate profiler


Download Filehttps://t.co/jqpncIx4Hh



But here comes the sad reality: sometimes things simply go wrong despite your best efforts. You can use all the preparation you want (and you should), but in the end, real life gets you. When you find yourself in a situation like the one described above, there is something that might help you: a profiler. More specifically, an NHibernate profiler.

NHibernate profiler is the debugger that visually illustrates everything and is used for real-time scenarios where the developers can achieve the perspective and details of insight while using NHibernate. In this article, we will have a detailed discussion about what the NHibernate profiler is, how to use this tool, and the installation of the NHibernate profiler and required packages.

NHibernate profiler is the tool that displays everything related to NHibernate in your application visually and also provides alerts wherever necessary. The architecture of this tool is designed and contributed by many of the efficient and top leaders of various renowned industries. The code review method is very comprehensive and concise as all the notifications and alerts are displayed and help recognize the patterns and any sort of issues related to applications, such as its misuse. In order to guide us to the correct path for our efforts, the profiler comes up with the links for finding out the problematic code and also display any related alerts.

We can make use of the NHibernate profiler in various ways. Firstly, let us understand the shortcuts that we can use to focus and move certain objects in the NHibernate profiler. Capital S is used to focus on the tab header of the session. If you want to focus on the tab header of Statements, then make use of the capital T key on the keyboard. For having the focus over the tab header of the Details section, you can click on the capital D key on the keyboard and in the case of the tab header of Statistics, make the use of the capital F key to focus on it. Taking about the movement to previous and next tabs, you can make the use of left and right keys on the keyboard, respectively. In case of moving to next or previous statements or sessions, click on the up and down arrow keys on the keyboard. These shortcut keys are supported by NHibernate profiler along with other standard operating system shortcuts.

Here, we can observe that a message for successful execution has been completed. Internally, it installs all the packages in a binary format that the NHibernate profiler will require. At the same time, the launching of NHibernate will be made. Although this is just for demo purposes, you can still use it for the upcoming 30 days as it is for free of cost version of the profiler. After following all the above steps, the profiler will be completely optimized for working along with the web applications.

Because of this NHibernate profiler tool, we can get detailed insights related to your application, and it proves very beneficial to understand how the application will be working internally. When the application complexity levels increase, this feature of the profiler proves to be a boon. Sometimes, you feel the necessity of using something like SQL profiler along with what knowledge you have of NHibernate.

We can make use of the NHibernate profiler to get the visual representation of all the executions happening inside the NHibernate application. In order to get detailed insights into how your application is performing, you can easily install and use the NHibernate profiler by using the Nuget package manager.

You can work out the best practices, and you can even document them, but this alone will not ensure that they are being followed. Monitoring your application with these profilers will shine the light on when your best practices are not being followed or not working as intended.

First when doing performance tuning you should install the NHibernate Profiler. Installation and use is pretty straightforward. You open the profiler when running the application and you will see a trace of all your queries. Below is a typical tracing session of NHibernate Profiler :

Now if we look at our NHibernate profiler you will see that we get a gray ball with the following message "Too many database calls per session". The reason is that NHibernate will execute a database call with each insert and this will result in 200 database calls. Too many database calls is bad for the performance and should be avoided.

The execution time of the query was 29ms. That's a difference of 143ms ! Which is a huge performance gain. When we check the NHibernate profiler you will see no more warnings and the amount of database calls is reduced to 5. Remember that our previous method had 200 database calls.

If you need to debug the performance on your website, knowing what SQL queries goes into the database is very useful.There are many advanced tools in the market that helps out, fx. NHibernate profiler that allows you to also see what queries are executed where in your code.

df19127ead
Reply all
Reply to author
Forward
0 new messages