Profile Performance of Orchard Websites Using MVC Mini Profiler

Profile Performance of Orchard Websites Using MVC Mini Profiler

I mentioned in a previous Orchard Blog Post the importance of looking at Orchard Websites as more than just a collection of modules, Custom Orchard Themes - Converting Existing Web Design and HTML Templates. An Orchard Web Developer has to look at the Orchard Website as a whole and optimize it, particularly for performance. When playing with the new Projector Module in Orchard CMS, I really started to look at its performance. Sure the Projector Module makes displaying information on the website easy by allowing one to query the content information in your orchard website using various filters, sort criteria, and layouts, but that comes with a price in performance as it has to work in a generic manner to support all kinds of scenarios. I wondered what that price looked like and used the MVC Mini Profiler for ASP.NET MVC to view the various database queries hitting the Orchard Database.

MVC Mini Profiler for Orchard CMS

Just like with ASP.NET MVC, you performance profile your Orchard Website and Database queries by enabling MVC Mini Profiler as an Action Filter. Enabling the Orchard Module for performance profiling your Orchard Websites brings up the familiar MVC Mini Profiler floating window that displays the total execution time of the Orchard Page.

Performance Profiler for Orchard Websites

When you click on the total time you can get a more detailed breakdown of the performance of your Orchard Website. Again, you get more execution times as determined by the MVC Mini Profiler for ASP.NET MVC.

Orchard CMS Performance Profiler

And last and more importantly, you can see the individual database calls and execution times for Orchard CMS by clicking the share link. If you haven't seen this before, you are in for one heck of an awakening as to how many database calls Orchard makes to display a page. Obviously, this varies depending on the amount of caching and database-oriented widgets you have on the page.

Orchard CMS Profile Database Calls

The MVC Mini Profiler shows you each and every database roundtrip executed by Orchard CMS using NHibernate. You see the actual SQL used to access the Orchard Database.

Conclusion

The MVC Mini Profiler is useful when performance profiling Orchard CMS Websites. The trick is finding the database calls you are interested in profiling. Check my Orchard CMS Performance Tutorials for interesting ways to improve the performance of your Orchard Websites.