I am currently trying to analyze a performance issue where an ASP.NET MVC razor view renders very slowly: it takes 40+ seconds to return a response to the browser. This issue does not always occur: usually the page loads in ~1/2 seconds.
Below is an image of a part of a MiniProfiler trace made of said page when it is loading slowly. The column on the right is the time passed since the start of the request, and the trace shows large jumps of several seconds there during the rendering of the razor views. What I don't really understand, is why the time in the other 2 columns ("duration (ms)" and "with children (ms)") does not reflect these multi second delays: I'd expect to see large numbers there as well.
What also jumps out at me is the fact that the large delays appear to occur when doing "Find: EditorTemplates/..." steps. Note that these templates do not exist (side note: I don't explicitly try to render these editor templates, but searching for them seems to be caused by the kendo mvc grid on the page). Could the large delays be caused by waiting on disk I/O to establish that these files do not exist? If so: how could this only occasionally take multiple seconds and normally complete relatively quickly?
How should I interpret these results and what could be the cause of the multi second delays?