dotTrace introduction

dotTrace by Jetbrains https://www.jetbrains.com/profiler/ is great for quickly understanding bottlenecks in a .NET codebase.

I have used this on a number of website codebases including Sitecore sites. Starting with user reports of slowness, the output of JMeter testing, or looking performance issues in NewRelic can help you to identify code which needs to be investigated.

One very simple approach is to:

  • open the profiler
  • attach to w3wp
  • click start
  • load a URL where the issue is present
  • click Get Snapshot and Wait

... then a report will appear which you can drill down into and quickly identify what the underlying issue might be.

I actually load the page once before clicking start, just to make sure I'm evaluating what happens every time the page loads, and not anything that might be happening once on website load.

Here's a few screenshots demonstrating dotTrace in action for the use case I described:

dotTrace has a 10 day free evaluation which can be paused - the 10 days refers to actual use.

licence

opening screen - under New Session, I selected Local

opening screen

select an application to profile - here I selected "Show All Processes"

opening screen

attach to process - after the processes loaded, I selected w3wp.exe

opening screen

this pop up appears. navigate to the page you wish to evaluate. Click Start, and reload the page. Once the page has loaded completely, click Get Snapshot and Wait

opening screen

after a little while, dotTrace collates the collected information and presents these results

opening screen

drill into the results to find where the performance issues are ocurring. Pay attention to those threads which have a flag next to them.

opening screen

Where you can see references in to external code, you can filter them out - for example Sitecore methods can be filtered out by right clicking, Click "Filter functions from assembly 'Sitecore.Kernel'

You can use Ctrl+F to search for known problem methods or classes.