A simple but effective mini-profiler for Umbraco
Download the package from our.umbraco and install it.
To start profiling your macros, make sure the setting “EnableMiniProfiler” is set to “true” in the web.config
and replace the <umbraco:Macro> tags for <profiler:Macro> in your templates, for example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
If you also want to profile your SqlServer or SqlCe, set the “EnableSqlMiniProfiler” setting in the web.config to “true”
Finally, add <profiler:Renderer runat=“server” /> at the end of your master page to display the MiniProfiler results
Profiling Umbraco back-end
If you want to profile the Umbraco back-end, you can add this at the end of the /umbraco/umbraco.aspx page:
Please visit http://profiler.jlusar.es to see a live example of how it works. Notice that no macro has been cached so you can see what happens on every request. You can also have a look at the source code on https://github.com/jorgelusar/miniprofiler-for-umbraco
Performance issues on uBootstrap
When I started profiling uBootrtrap I notice that some macros such as the Navigation.cshtml where doing lots of request to the database, and the main problems was that I was using some syntactic sugar such as item.Texpages to retrieve al descendants node of type “Textpage”. Then I removed that and change it for item.Descendants(“Textpage”) and the macro was being loaded about 8x faster and no sql calls. So if you have this sort of syntax in your razor views, I’d recommend to use .Descendants(“SomeTemplate”).